Message265697
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. |
|
Date |
User |
Action |
Args |
2016-05-16 14:46:54 | David Pitchford | set | recipients:
+ David Pitchford |
2016-05-16 14:46:54 | David Pitchford | set | messageid: <1463410014.02.0.132222711737.issue27037@psf.upfronthosting.co.za> |
2016-05-16 14:46:53 | David Pitchford | link | issue27037 messages |
2016-05-16 14:46:53 | David Pitchford | create | |
|