Commit ea9b3a5
authored
Reset file pointer to 0 when reading file stream (#7304)
* Reset file pointer to 0 when reading file stream
Instead of raising a ValueError about the file pointer not being at the start of the file, reset the file pointer automatically to zero, and warn that the pointer has been reset.
* Expect warning rather than ValueError for test_open_twice
Fixes the `Failed: DID NOT RAISE <class 'ValueError'>`
* Remove checks for errors raised in test_open_fileobj
The ValueError and RuntimeWarning isn't raised anymore.
* Fix typo form -> from
* Add changelog entry for bugfix
* Remove warning about resetting file pointer to zero
File pointer is reset to zero after reading the magic byte number anyway, so should be ok not to warn about this.1 parent 0e5e3fe commit ea9b3a5
3 files changed
+10
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
| 659 | + | |
664 | 660 | | |
665 | 661 | | |
666 | 662 | | |
667 | | - | |
| 663 | + | |
668 | 664 | | |
669 | 665 | | |
670 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3159 | 3159 | | |
3160 | 3160 | | |
3161 | 3161 | | |
3162 | | - | |
3163 | | - | |
3164 | | - | |
3165 | | - | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
3166 | 3166 | | |
3167 | | - | |
3168 | | - | |
| 3167 | + | |
3169 | 3168 | | |
3170 | 3169 | | |
3171 | 3170 | | |
| |||
3197 | 3196 | | |
3198 | 3197 | | |
3199 | 3198 | | |
3200 | | - | |
3201 | | - | |
3202 | | - | |
3203 | | - | |
3204 | | - | |
3205 | | - | |
3206 | | - | |
3207 | | - | |
3208 | | - | |
| 3199 | + | |
3209 | 3200 | | |
3210 | 3201 | | |
3211 | 3202 | | |
| |||
0 commit comments