Roundup Robot added the comment:
New changeset e647229c422b by Nadeem Vawda in branch '2.7':
Issue #5148: Ignore 'U' in mode given to gzip.open() and gzip.GzipFile().
http://hg.python.org/cpython/rev/e647229c422b
--
nosy: +python-dev
___
Python
Nadeem Vawda added the comment:
The data corruption issue is now fixed in the 2.7 branch.
In 3.x, using a mode containing 'U' results in an exception rather than silent
data corruption. Additionally, gzip.open() has supported text modes
(rt/wt/at) and newline translation since 3.3 [issue
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
nosy: +nadeem.vawda
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5148
___
___
Python-bugs-list
Changes by Skip Montanaro s...@pobox.com:
--
nosy: -skip.montanaro
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5148
___
___
Python-bugs-list
Art Gillespie agill...@gmail.com added the comment:
The problem appears to be that the gzip module simply doesn't support
universal newlines yet.
I'm currently working on the zipfile module's universal newline support
(issue6759) so if nobody else is working on this, I'll do it.
I'm not sure
Jack Diederich jackd...@gmail.com added the comment:
Unfortunately universal newlines are more complicated than replace() can
handle. See io.py, you may be able to use one of those classes to the
the universal new line handling on the cheap (or at least easy).
--
nosy: +jackdied
Radek szklarc...@yahoo.com added the comment:
Same bug in 2.5, I don't know if the patch applies to 2.5
--
nosy: +radek768
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5148
___
Skip Montanaro s...@pobox.com added the comment:
Seems like this should be fairly easy to do right. 'U' needs to be
removed from the flags but then applied to the lines read from the
stream.
--
keywords: +easy
nosy: +skip.montanaro
stage: - needs patch
Skip Montanaro s...@pobox.com added the comment:
Here's a patch against trunk. Extra test case and minor doc tweak
included.
--
keywords: +patch
Added file: http://bugs.python.org/file12945/gzipU.diff
___
Python tracker rep...@bugs.python.org
Changes by Skip Montanaro s...@pobox.com:
--
keywords: +needs review
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5148
___
New submission from Christopher Barker chris.bar...@noaa.gov:
If you pass the 'U' (Universal newlines) flag into gzip.open(), the flag
gets passed into the file open command used to open the gzip file
itself. As the 'U' flag can cause changes in teh data (Lineffed
translation), when it is used
11 matches
Mail list logo