Commit b6f80d7
Merge python#26
26: warn for truncate r=ltratt a=nanjekyejoannah
Use seek(0) before doing truncate(0)
BytesIO.truncate() does not shift the file pointer,
so we need to seek() to move the file pointer,
otherwise writing after truncating will mess up the
stream.
s.truncate(0) -> s.seek(0)
s.truncate(0)
Co-authored-by: Joannah Nanjekye <jnanjeky@unb.ca>2 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
286 | 294 | | |
287 | 295 | | |
288 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
| |||
0 commit comments