Skip Menu |
 

This queue is for tickets about the Python-Serialise-Pickle CPAN distribution.

Report information
The Basics
Id: 20244
Status: open
Priority: 0/
Queue: Python-Serialise-Pickle

People
Owner: Nobody in particular
Requestors: imacat [...] mail.imacat.idv.tw
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: (no value)

Attachments
Python-Serialise-Pickle-0.02.tar.gz



Subject: Cannot Handle Mailman Data File config.pck
Download (untitled) / with headers
text/plain 692b
=================== Hi. This is imacat from Taiwan. I tried to read Mailman database with Python::Serialise::Pickle tonight, and found an error. This is what I got: imacat@rinse /tmp % cat /tmp/test.pl #! /usr/bin/perl -w use Python::Serialise::Pickle; use Data::Dumper; my ($pr, $data); $pr = Python::Serialise::Pickle->new("/var/lib/mailman/lists/mailman/config.pck"); while ($data = $pr->load) { print Data::Dumper->Dump([$data], [qw($data)]); } $pr->close; __END__ imacat@rinse /tmp % /tmp/test.pl LOAD C=} We have no handler to deal with '}' imacat@rinse /tmp % It seems that Python::Serialise::Pickle cannot handle a certain data type. Could this be fixed? Thank you.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #20244] Cannot Handle Mailman Data File config.pck
Date: Mon, 3 Jul 2006 11:48:58 +0100
To: via RT <bug-Python-Serialise-Pickle [...] rt.cpan.org>
From: Simon Wistow <simon [...] thegestalt.org>
Download (untitled) / with headers
text/plain 439b
On Sun, Jul 02, 2006 at 02:23:54PM -0400, via RT said: Show quoted text
> Hi. This is imacat from Taiwan. I tried to read Mailman database > with Python::Serialise::Pickle tonight, and found an error. This is > what I got:
The Python pickle format has changed and I haven't had time to sit down and parse the new format. A work around might be to use Python to dump out a YAML file and then use Perl to read that back in. Apologies, Simon
From: imacat [...] mail.imacat.idv.tw
Download (untitled) / with headers
text/plain 842b
On 2006-07-03 06:49:22 星期一, simon@thegestalt.org wrote: Show quoted text
> On Sun, Jul 02, 2006 at 02:23:54PM -0400, via RT said:
> > Hi. This is imacat from Taiwan. I tried to read Mailman database > > with Python::Serialise::Pickle tonight, and found an error. This is > > what I got:
> The Python pickle format has changed and I haven't had time to sit down > and parse the new format. > A work around might be to use Python to dump out a YAML file and then > use Perl to read that back in.
Well... If I can do that, I would code my application in pure Python and need no Python::Serialise::Pickle at all. ^^; Thank you for this anyway. Currently I'm wrapping the output of mailman scripts. It's quite stupid and inefficient. I'm waiting for your new Python::Serialise::Pickle. Please tell me if there is anything I can help.
From: hjp [...] hjp.at
Download (untitled) / with headers
text/plain 739b
On Mon Jul 03 06:49:22 2006, simon@thegestalt.org wrote: Show quoted text
> On Sun, Jul 02, 2006 at 02:23:54PM -0400, via RT said:
> > Hi. This is imacat from Taiwan. I tried to read Mailman database > > with Python::Serialise::Pickle tonight, and found an error. This is > > what I got:
> > The Python pickle format has changed and I haven't had time to sit down > and parse the new format.
I ran into the same problem this week and implemented enough of protocol version 1 to be able to parse the Mailman config files I have. It's still not even a complete implementation of version 1 (not to mention version 2), it's quite buggy, undocumented and missing test cases. But if you are interested I'll clean it up and send you the patches. hp
From: hjp [...] hjp.at
Download (untitled) / with headers
text/plain 683b
On Sat Jan 05 13:36:08 2008, hjp@hjp.at wrote: Show quoted text
> I ran into the same problem this week and implemented enough of protocol > version 1 to be able to parse the Mailman config files I have. It's > still not even a complete implementation of version 1 (not to mention > version 2), it's quite buggy, undocumented and missing test cases. But > if you are interested I'll clean it up and send you the patches.
Well, I added tests for all the new opcodes, and fixed some of the old ones. There may still be some bugs, but the tests all pass now and they cover all source lines, so I guess it's clean enough now. I am attaching the complete distribution because the patch would be larger.

Message body not shown because it is not plain text.

From: imacat [...] mail.imacat.idv.tw
Download (untitled) / with headers
text/plain 1.7k
On Sun Jan 06 22:49:05 2008, hjp@hjp.at wrote: Show quoted text
> Well, I added tests for all the new opcodes, and fixed some of the old > ones. There may still be some bugs, but the tests all pass now and they > cover all source lines, so I guess it's clean enough now.
Dear Peter, Hi. This is imacat from Taiwan. Sorry for the reply late. Well, your test suites fails. 1. That t/tmp is read-only after untarring the source. I did a "chmod +w t/tmp" and things work. Module::Build changes every source file to read-only before "./Build dist". You can either use ExtUtils::MakeMaker instead, or use another file name for your purpose. I would suggest you to untar your "./Build dist" source and test again before release. Several unexpected things happens during "./Build dist", in my experience. 2. That float comparison fails at t/09binnumbers.t. The failure is attached below: imacat@cotton tmp/Python-Serialise-Pickle-0.02 % perl -Iblib/lib t/09binnumbers.t 1..7 ok 1 - use Python::Serialise::Pickle; ok 2 LOAD ok 3 - binint1 LOAD ok 4 - binint2 LOAD ok 5 - binint (positive) LOAD ok 6 - binint (negative) LOAD not ok 7 - binfloat # Failed test 'binfloat' # at t/09binnumbers.t line 15. # got: '3.14000000000000012' # expected: '3.14' # Looks like you failed 1 test of 7. imacat@cotton tmp/Python-Serialise-Pickle-0.02 % I suppose this fails on x86_64 and "i386 compiled with uselongdouble". I do not remember how others solve this, but I suppose you can use: is(sprintf("%f", $ps->load) + 0, 3.14, "binfloat"); instead of is($ps->load, 3.14, "binfloat"); I suppose there must be wiser solution than this somewhere else. Please tell me if you need any more information, or if I could be of any help. Thank you.
From: hjp [...] hjp.at
Download (untitled) / with headers
text/plain 2.1k
On Tue Feb 26 01:33:54 2008, IMACAT wrote: Show quoted text
> On Sun Jan 06 22:49:05 2008, hjp@hjp.at wrote:
> > Well, I added tests for all the new opcodes, and fixed some of the old > > ones. There may still be some bugs, but the tests all pass now and they > > cover all source lines, so I guess it's clean enough now.
> > Hi. This is imacat from Taiwan. Sorry for the reply late.
No problem. I'm late, too (somehow I expected rt to send me mail if the ticket changes, but apparently it doesn't) and the Simon is late, too ;-). Show quoted text
> Well, your test suites fails. > > 1. That t/tmp is read-only after untarring the source.
It shouldn't be in source. Apparently I added it to the MANIFEST by mistake. (And the tests which create it should probably remove it when they are finished). Show quoted text
> I would suggest you to untar your "./Build dist" source and test > again before release.
Good advice. I'll keep it in mind. Show quoted text
> 2. That float comparison fails at t/09binnumbers.t. The failure is > attached below: > > imacat@cotton tmp/Python-Serialise-Pickle-0.02 % perl -Iblib/lib > t/09binnumbers.t > 1..7 > ok 1 - use Python::Serialise::Pickle; > ok 2 > LOAD > ok 3 - binint1 > LOAD > ok 4 - binint2 > LOAD > ok 5 - binint (positive) > LOAD > ok 6 - binint (negative) > LOAD > not ok 7 - binfloat > # Failed test 'binfloat' > # at t/09binnumbers.t line 15. > # got: '3.14000000000000012' > # expected: '3.14' > # Looks like you failed 1 test of 7. > imacat@cotton tmp/Python-Serialise-Pickle-0.02 % > > I suppose this fails on x86_64 and "i386 compiled with
uselongdouble". Yes, that's expected. The test was designed to check if the result is exact with 64 bit doubles. It cannot work with longer (or shorter) doubles. It could be skipped for other sizes, but there is a better way ... Show quoted text
> I do not remember how others solve this, but I suppose you can use: > > is(sprintf("%f", $ps->load) + 0, 3.14, "binfloat");
Nope, that doesn't check if the result is exactly what it should be. A better test would be is($ps->load, 3.140000000000000124344978758017532527446746826171875, "binfloat"); that should work with all possible floating point representations. hp
Download (untitled) / with headers
text/plain 154b
I would very much like to see 0.02 (or later) officially released. Reading works for me, but I'm not too keen on playing with writing until it's official.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.