Re: Help with python-list archives

2012-01-10 Thread Anssi Saari
Ian Kelly writes: > Probably nobody has noticed it until now. It seems to be a quirk of > the archive files that they are double-gzipped... Interesting, but I don't think the files are actually double-gzipped. If I download http://mail.python.org/pipermail/python-list/2012-January.txt.gz with w

Re: Help with python-list archives

2012-01-06 Thread random joe
On Jan 6, 1:41 am, Ian Kelly wrote: > One could also avoid creating the intermediate file by using a > StringIO to keep it in memory instead: Yes StringIO is perfect for this. Many thanks to all who replied. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python-list archives

2012-01-05 Thread Ian Kelly
On Thu, Jan 5, 2012 at 9:08 PM, random joe wrote: > PS: I wonder why no one has added a note to the Python-list archives > to advise people about the bug? Probably nobody has noticed it until now. It seems to be a quirk of the archive files that they are double-gzipped, and most people probably

Re: Help with python-list archives

2012-01-05 Thread Ian Kelly
On Thu, Jan 5, 2012 at 8:00 PM, MRAB wrote: > import gzip > > in_file = gzip.open(r"C:\2012-January.txt.gz") > out_file = open(r"C:\2012-January.txt.tmp", "wb") > out_file.write(in_file.read()) > in_file.close() > out_file.close() > > in_file = gzip.open(r"C:\2012-January.txt.tmp") > out_file = op

Re: Help with python-list archives

2012-01-05 Thread Chris Angelico
On Fri, Jan 6, 2012 at 3:08 PM, random joe wrote: > Nevermind. Notepad was the problem. After using a real editor the text > is displayed correctly! Thanks for help everyone! ... or that could be your problem :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python-list archives

2012-01-05 Thread Chris Angelico
On Fri, Jan 6, 2012 at 3:01 PM, random joe wrote: > THis works however there is one more tiny hiccup. The text has lost > all significant indention and newlines. Was this intended or is this a > result of another bug? I'm seeing it as plain text, with proper newlines. There's no indentation as it

Re: Help with python-list archives

2012-01-05 Thread random joe
On Jan 5, 10:01 pm, random joe wrote: > On Jan 5, 9:00 pm, MRAB wrote: > > import gzip > > > in_file = gzip.open(r"C:\2012-January.txt.gz") > > out_file = open(r"C:\2012-January.txt.tmp", "wb") > > out_file.write(in_file.read()) > > in_file.close() > > out_file.close() > > > in_file = gzip.open(

Re: Help with python-list archives

2012-01-05 Thread random joe
On Jan 5, 9:00 pm, MRAB wrote: > On 06/01/2012 02:14, random joe wrote: > > > On Jan 5, 7:27 pm, MRAB  wrote: > > >>  I've found that if I gunzip it twice (gunzip it and then gunzip the > >>  result) using the gzip module I get the text file. > > > On a windows machine? If so, can you post a code

Re: Help with python-list archives

2012-01-05 Thread MRAB
On 06/01/2012 02:14, random joe wrote: On Jan 5, 7:27 pm, MRAB wrote: I've found that if I gunzip it twice (gunzip it and then gunzip the result) using the gzip module I get the text file. On a windows machine? If so, can you post a code snippet please? Thanks import gzip in_file = gzip

Re: Help with python-list archives

2012-01-05 Thread random joe
On Jan 5, 7:27 pm, MRAB wrote: > I've found that if I gunzip it twice (gunzip it and then gunzip the > result) using the gzip module I get the text file. On a windows machine? If so, can you post a code snippet please? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python-list archives

2012-01-05 Thread MRAB
On 06/01/2012 00:10, Ian Kelly wrote: On Thu, Jan 5, 2012 at 4:52 PM, random joe wrote: Sure. Take the most recent file as example. "2012 - January.txt.gz". If you use the python doc example this is the result. If i use "r" or "rb" the result is the same. import gzip f1 = gzip.open('C:\\

Re: Help with python-list archives

2012-01-05 Thread random joe
On Jan 5, 6:10 pm, Ian Kelly wrote: > Interesting.  I tried this on a Linux system using both gunzip and > your code, and both worked fine to extract that file.  I also tried > your code on a Windows system, and I get the same result that you do. > This appears to be a bug in the gzip module under

Re: Help with python-list archives

2012-01-05 Thread Ian Kelly
On Thu, Jan 5, 2012 at 4:52 PM, random joe wrote: > Sure. Take the most recent file as example. "2012 - January.txt.gz". > If you use the python doc example this is the result. If i use "r" or > "rb" the result is the same. > import gzip f1 = gzip.open('C:\\2012-January.txt.gz', 'rb') >>

Re: Help with python-list archives

2012-01-05 Thread Ian Kelly
On Thu, Jan 5, 2012 at 4:39 PM, Miki Tebeka wrote: > Is there Google groups search not good enough? > (groups.google.com/group/comp.lang.python) My experience with the Google groups search (and Google groups in general) in the past has been terrible. If you're looking for a specific thread, it

Re: Help with python-list archives

2012-01-05 Thread random joe
On Jan 5, 5:39 pm, Miki Tebeka wrote: > Is the Google groups search not good enough? That works but i would like to do some regexes and set up some defaults. > Also, can you give an example of the code and an input file? Sure. Take the most recent file as example. "2012 - January.txt.gz". If yo

Re: Help with python-list archives

2012-01-05 Thread Miki Tebeka
Is there Google groups search not good enough? (groups.google.com/group/comp.lang.python) Also, can you give an example of the code and an input file? -- http://mail.python.org/mailman/listinfo/python-list

Help with python-list archives

2012-01-05 Thread random joe
Hi. I am new to python and wanted to search the python-list archives for answers to my many questions but i can't seem to get the archive files to uncompressed? What gives? From what i understand they are gzip files so i assumed the gzip module would work, but no! The best i could do was to get a