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.

Author berker.peksag
Recipients bbayles, berker.peksag, mkleehammer
Date 2018-07-24.03:14:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532402075.83.0.56676864532.issue34202@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the report! Support for path-like objects was added in 3.6.2. I think you either have 3.6.0 or 3.6.1 installed on your system. Please upgrade it to the latest bugfix release.

With 3.6.6, I got the following results:

>>> import zipfile
>>> from pathlib import Path
>>> path = Path('spam.zip')
>>> zf = zipfile.ZipFile(path, 'w')
>>> zf.writestr('test.txt', 'Hello, Sailor!')
>>> zf.close()

$ ./python -m zipfile -l spam.zip 
File Name                                             Modified             Size
test.txt                                       2018-07-24 06:10:52           14
History
Date User Action Args
2018-07-24 03:14:35berker.peksagsetrecipients: + berker.peksag, mkleehammer, bbayles
2018-07-24 03:14:35berker.peksagsetmessageid: <1532402075.83.0.56676864532.issue34202@psf.upfronthosting.co.za>
2018-07-24 03:14:35berker.peksaglinkissue34202 messages
2018-07-24 03:14:34berker.peksagcreate