-
-
Couldn't load subscription status.
- Fork 181
Closed
Labels
Description
Python 35 (32Bit)
Pyfilesystem: 2.2.1
Testcode:
from fs import zipfs
testfs = zipfs.ZipFS('test.zip',write=True)
testfile = testfs.open('testfile.txt','w')
testfile.write('Hello World')
testfile.close()
testfs.close()
Result: An empty ZipFile is created.
After looking in the code I saw a Try,Finally around
self.write_zip() (zipfs.py:239)
This is really bad, because here a Silent Error + Data Loss happened.
After disabling the Try Finally I got this Error:
Traceback (most recent call last):
File "error.py", line 7, in <module>
testfs.close()
File "C:\Python35-32\lib\site-packages\fs\zipfs.py", line 239, in close
self.write_zip()
File "C:\Python35-32\lib\site-packages\fs\zipfs.py", line 271, in write_zip
encoding=encoding or self.encoding,
File "C:\Python35-32\lib\site-packages\fs\compress.py", line 61, in write_zip
for path, info in gen_walk:
File "C:\Python35-32\lib\site-packages\fs\walk.py", line 385, in info
for _path, info in _walk:
File "C:\Python35-32\lib\site-packages\fs\walk.py", line 405, in _walk_breadth
for info in self._scan(fs, dir_path, namespaces=namespaces):
File "C:\Python35-32\lib\site-packages\fs\walk.py", line 277, in _scan
for info in fs.scandir(dir_path, namespaces=namespaces):
File "C:\Python35-32\lib\site-packages\fs\osfs.py", line 459, in _scandir
for dir_entry in scandir(sys_path):
TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead
Any Idea what I can do to get a zipfile created?