Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-21 Thread Antoine Pitrou
Hello, Le Sun, 20 Dec 2009 17:08:33 +0100, Johannes Bauer a écrit : > > #!/usr/bin/python3 > import gzip > x = gzip.open("testdatei", "wb") > x.write("ä") The bug here is that you are trying to write an unicode text string ("ä") to a binary file (a gzip file). This bug has been fixed now; in th

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Mark Tolonen
"Diez B. Roggisch" wrote in message news:7p7328f3r1r2...@mid.uni-berlin.de... Johannes Bauer schrieb: > Hello group, > > with this following program: > > #!/usr/bin/python3 > import gzip > x = gzip.open("testdatei", "wb") > x.write("ä") > x.close() > > I get a broken .gzip file when decompressin

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Diez B. Roggisch
Johannes Bauer schrieb: Hello group, with this following program: #!/usr/bin/python3 import gzip x = gzip.open("testdatei", "wb") x.write("ä") x.close() I get a broken .gzip file when decompressing: $ cat testdatei |gunzip ä gzip: stdin: invalid compressed data--length error As it only happe

Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Johannes Bauer
Hello group, with this following program: #!/usr/bin/python3 import gzip x = gzip.open("testdatei", "wb") x.write("ä") x.close() I get a broken .gzip file when decompressing: $ cat testdatei |gunzip ä gzip: stdin: invalid compressed data--length error As it only happens with UTF-8 characters,