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 David Pitchford
Recipients David Pitchford
Date 2016-05-16.14:46:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463410014.02.0.132222711737.issue27037@psf.upfronthosting.co.za>
In-reply-to
Content
Universal newline support for the read method of ZipFileExt objects created by calling the ZipFile.open method is not working. The attached archive contains a test script for demonstrating the behavior; unzip the files into the same directory and run the script. It tests opening a text file with all three types of line endings in five different ways: with the file.read method in modes 'rU', 'r', and 'rb', and with the zipfile.ZipFileExt.read and readlines methods in mode 'rU'.

The first two and last methods both read the file with the expected universal newline support; the '\r' and '\r\n' endings are translated to '\n'. But zipfile.ZipFileExt.read, even with universal newline support, leaves these endings untouched, just like the 'rb' mode.

This issue seems to have been raised in the past (http://bugs.python.org/issue6759) for Python 3.3, with the decision apparently made to deprecate universal newline support for this method. Is this also the case for Python 2.7, and if so, why does the zipfile documentation for both versions not mention this missing functionality? As a user, I can say that this deprecation is certainly disrupting my workflow; it is not at all the behavior I expected.

I am running Python 2.7.11 on a 64-bit copy of Windows 7 Professional SP1.
History
Date User Action Args
2016-05-16 14:46:54David Pitchfordsetrecipients: + David Pitchford
2016-05-16 14:46:54David Pitchfordsetmessageid: <1463410014.02.0.132222711737.issue27037@psf.upfronthosting.co.za>
2016-05-16 14:46:53David Pitchfordlinkissue27037 messages
2016-05-16 14:46:53David Pitchfordcreate