Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18570
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'bug': 0.02; 'sure.': 0.05; 'python': 0.08; '"r"': 0.09; '>>>>': 0.09; 'format?': 0.09; 'skip:\\ 30': 0.09; 'skip:l 60': 0.09; 'subject:python': 0.10; '"rb"': 0.16; "'r')": 0.16; "'rb')": 0.16; 'compression': 0.16; 'gzip': 0.16; 'cc:addr:python-list': 0.16; 'linux': 0.17; 'subject:Help': 0.17; 'wrote:': 0.18; 'example.': 0.18; 'interesting.': 0.18; 'jan': 0.19; 'appears': 0.19; 'seems': 0.20; 'cc:no real name:2**0': 0.20; 'trying': 0.21; 'subject:list': 0.21; 'result.': 0.21; 'header:In-Reply-To:1': 0.22; 'archive': 0.23; 'cc:2**0': 0.24; 'fine': 0.24; 'correctly.': 0.24; 'extract': 0.24; 'code': 0.25; 'module': 0.26; 'windows': 0.26; 'import': 0.27; 'tried': 0.27; 'code,': 0.27; 'do.': 0.28; 'random': 0.28; 'message-id:@mail.gmail.com': 0.28; 'fine.': 0.29; 'worked': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'example': 0.29; 'handling': 0.30; 'tar': 0.30; 'thu,': 0.32; 'there': 0.33; 'received:209.85.212': 0.34; 'file.': 0.34; 'doc': 0.34; 'something': 0.35; 'google': 0.35; 'joe': 0.35; 'file': 0.36; 'subject:with': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'could': 0.37; 'open': 0.38; 'using': 0.38; 'received:209.85': 0.38; 'same.': 0.39; 'else': 0.39; 'files': 0.39; 'why': 0.39; 'received:209': 0.40; 'download': 0.60; 'your': 0.61; 'levels': 0.64; '2012': 0.67; 'something.': 0.84; 'locally': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Tatwo2sudWfCaUhJLIxDJuYLcz4V3JuxJ88s1ETgFTM=; b=wS/ZTuLjE4sY0qxv94yFY+Aumtphdv6y7dbkR4W0JbxDjPs/OArYk4wMXQZulyvOIO 4Nl15R9KyP7nwiecR0DxJx517bXl9REJwetORKHueGEdNNzkykmMmWtDpg2xYQ9PTeq/ 02SeaeiGQGd+gRPbEjisrG5aVR+BmgQwYIfLk= |
| MIME-Version | 1.0 |
| In-Reply-To | <8f3b98e1-3b21-4f06-8456-0a555a7ee523@u32g2000yqe.googlegroups.com> |
| References | <78484055-dd01-4237-9217-9eb038fc744f@p16g2000yqd.googlegroups.com> <14749754.624.1325806776674.JavaMail.geo-discussion-forums@vbgw2> <8f3b98e1-3b21-4f06-8456-0a555a7ee523@u32g2000yqe.googlegroups.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Thu, 5 Jan 2012 17:10:07 -0700 |
| Subject | Re: Help with python-list archives |
| To | random joe <pywin32@gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4463.1325808641.27778.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1325808641 news.xs4all.nl 6957 [2001:888:2000:d::a6]:56981 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:18570 |
Show key headers only | View raw
On Thu, Jan 5, 2012 at 4:52 PM, random joe <pywin32@gmail.com> 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')
>>>> data = f1.read()
>>>> data[:100]
> '\x1f\x8b\x08\x08x\n\x05O\x02\xff/srv/mailman/archives/private/python-
> list/2012-January.txt\x00\xec\xbdy\x7f\xdb\xc6\xb50\xfcw\xf0)\xa6z|+
> \xaa!!l\xdc\x14[\x8b-;V\xe2-\x92\x12'
>>>> f2 = gzip.open('C:\\2012-January.txt.gz', 'r')
>>>> data = f2.read()
>>>> data[:100]
> '\x1f\x8b\x08\x08x\n\x05O\x02\xff/srv/mailman/archives/private/python-
> list/2012-January.txt\x00\xec\xbdy\x7f\xdb\xc6\xb50\xfcw\xf0)\xa6z|+
> \xaa!!l\xdc\x14[\x8b-;V\xe2-\x92\x12'
>
> The docs and google provide no clear answer. I even tried 7zip and
> ended up with nothing but gibberish characters. There must be levels
> of compression or something. Why could they not simply use the tar
> format? Is there anywhere else one can download the archives?
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 Windows.
I think there may be something peculiar about the archive files that
the module is not handling correctly. If I gunzip the file locally
and then gzip it again before trying to open it in Python, then
everything seems to be fine.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 14:44 -0800
Re: Help with python-list archives Miki Tebeka <miki.tebeka@gmail.com> - 2012-01-05 15:39 -0800
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 15:52 -0800
Re: Help with python-list archives Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-05 17:10 -0700
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 16:45 -0800
Re: Help with python-list archives MRAB <python@mrabarnett.plus.com> - 2012-01-06 01:27 +0000
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 18:14 -0800
Re: Help with python-list archives MRAB <python@mrabarnett.plus.com> - 2012-01-06 03:00 +0000
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 20:01 -0800
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-05 20:08 -0800
Re: Help with python-list archives Chris Angelico <rosuav@gmail.com> - 2012-01-06 15:12 +1100
Re: Help with python-list archives Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-06 00:45 -0700
Re: Help with python-list archives Anssi Saari <as@sci.fi> - 2012-01-10 16:47 +0200
Re: Help with python-list archives Chris Angelico <rosuav@gmail.com> - 2012-01-06 15:11 +1100
Re: Help with python-list archives Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-06 00:41 -0700
Re: Help with python-list archives random joe <pywin32@gmail.com> - 2012-01-06 16:55 -0800
Re: Help with python-list archives Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-05 17:02 -0700
csiph-web