[issue28231] zipfile does not support pathlib
Jeremy Freeman
report at bugs.python.org
Thu Jan 5 10:51:50 EST 2017
Jeremy Freeman added the comment:
This also affects python 3.5 on Windows and OSX.
Python 3.5.2 (default, Sep 21 2016, 15:07:18)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> import zipfile
>>> f = Path('zipfile.zip')
>>> with zipfile.ZipFile(f) as zf:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jeremy/.pyenv/versions/3.5.2/lib/python3.5/zipfile.py", line 1026, in __init__
self._RealGetContents()
File "/Users/jeremy/.pyenv/versions/3.5.2/lib/python3.5/zipfile.py", line 1089, in _RealGetContents
endrec = _EndRecData(fp)
File "/Users/jeremy/.pyenv/versions/3.5.2/lib/python3.5/zipfile.py", line 241, in _EndRecData
fpin.seek(0, 2)
AttributeError: 'PosixPath' object has no attribute 'seek'
----------
nosy: +jtf621
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28231>
_______________________________________
More information about the Python-bugs-list
mailing list