This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年02月08日 21:38 by mattip, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg235568 - (view) | Author: mattip (mattip) * | Date: 2015年02月08日 21:38 | |
f=open('abc.txt', 'w+')
f.seek(0, 42)
does not raise an exception on windows, python2.7
|
|||
| msg235572 - (view) | Author: Eryk Sun (eryksun) * (Python triager) | Date: 2015年02月08日 22:38 | |
The whence argument is used in a switch statement that handles SEEK_END and SEEK_CUR. It doesn't raise an error for an invalid whence value. It just falls through to the fsetpos call. _portable_fseek https://hg.python.org/cpython/file/648dcafa7e5f/Objects/fileobject.c#l692 0:000> k 3 Child-SP RetAddr Call Site 00000000`0021fa68 00000000`1e0ac84f MSVCR90!fsetpos 00000000`0021fa70 00000000`1e0aeea3 python27!_portable_fseek+0x6f 00000000`0021faa0 00000000`1e0c3d09 python27!file_seek+0x123 Why does it manually handle whence and call fgetpos/fsetpos instead of calling _fseeki64? fseek, _fseeki64 https://msdn.microsoft.com/en-us/library/75yw9bf3%28v=vs.90%29.aspx |
|||
| msg235981 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2015年02月14日 18:19 | |
I can't say why 2.7 doesn't use _fseeki64, but 3.5 certainly does. Possibly it's a significant change of behaviour that would break backwards compatibility? Making a currently working call raise new exceptions is certainly worth double-checking before introducing into a maintenance release. |
|||
| msg366735 - (view) | Author: Zackery Spytz (ZackerySpytz) * (Python triager) | Date: 2020年04月18日 18:58 | |
Python 2 is EOL. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:12 | admin | set | github: 67602 |
| 2020年04月18日 20:39:05 | ned.deily | set | status: open -> closed resolution: wont fix stage: resolved |
| 2020年04月18日 18:58:11 | ZackerySpytz | set | nosy:
+ ZackerySpytz messages: + msg366735 |
| 2015年02月14日 18:19:33 | steve.dower | set | messages: + msg235981 |
| 2015年02月08日 22:38:09 | eryksun | set | nosy:
+ eryksun messages: + msg235572 |
| 2015年02月08日 21:38:58 | mattip | create | |