Skip Menu |

This queue is for tickets about the Net-IMAP-Server CPAN distribution.

Report information
The Basics
Id: 58160
Status: resolved
Priority: 0/
Queue: Net-IMAP-Server

People
Owner: Nobody in particular
Requestors: jettero [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.27
Fixed in: 1.28



Subject: ugh, datetimeparsing
I've been chasing this bug for many months. Maybe even a year. It's pretty subtle. I include a copy of Net-IMAP-Server in Net-IMAP-Simple for testing and very occasionally (and I now know only on single digit dates like today) the t/22 copy test would fail. WHY WHY WHY? The reason is in Net::IMAP::Server::Message::internaldate(). Specifically, use DateTime::Format::Strptime; my $x = DateTime::Format::Strptime->new(pattern => "%e-%b-%Y %T %z"); $x->parse_datetime("5-Jun-2010 08:25:12 -0400"); # fine $x->parse_datetime(" 5-Jun-2010 08:25:12 -0400"); # not fine and a couple lines above the parse_datetime() is this: $self->{internaldate} = $value->strftime("%e-%b-%Y %T %z"); ... which leads with a space on single digit days. This causes $value to be undef and ->truncate to propagate a fail upwards. -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Subject: ugh, datetime parsing
I'd also like to add that I have absolutely no idea how you might want to fix it, so I didn't submit any ideas. In my inc/ dir, I trim whitespace before and after dates in both $self->{internal_date} and in $value. I suspect that's not how you'll want to do it. -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Subject: Re: [rt.cpan.org #58160] ugh, datetimeparsing
Date: Mon, 07 Jun 2010 14:58:14 -0400
To: bug-Net-IMAP-Server <bug-net-imap-server [...] rt.cpan.org>
From: Alex Vandiver <alex [...] chmrr.net>
At Sat Jun 05 08:48:25 -0400 2010, Paul Miller via RT wrote: Show quoted text
> I've been chasing this bug for many months. Maybe even a year. It's > pretty subtle. I include a copy of Net-IMAP-Server in Net-IMAP-Simple for > testing and very occasionally (and I now know only on single digit dates > like today) the t/22 copy test would fail. WHY WHY WHY?
Can you try HEAD from http://github.com/bestpractical/net-imap-server and let me know if this fixes this bug (and also rt.cpan #58162)? - Alex -- Networking -- only one letter away from not working
On Mon Jun 07 14:58:21 2010, alex@chmrr.net wrote: Show quoted text
> Can you try HEAD from http://github.com/bestpractical/net-imap-server > and let me know if this fixes this bug (and also rt.cpan #58162)? > - Alex
No such luck, that %n just adds a newline before the space before the 8. Added "die ">>$self->{internaldate}<<"" at line 83... Show quoted text
>>
8-Jun-2010 07:27:24 -0400<< at inc/Net/IMAP/Server/Message.pm line 83. This get's a lot harder to test in 2 days. I hate changing my clock. -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Oh, I meant to paste this in too: Can't call method "truncate" on an undefined value at inc/Net/IMAP/Server/Message.pm line 87. (Although I'm sure I mentioned the precise error previously...) -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Subject: Re: [rt.cpan.org #58160] ugh, datetimeparsing
Date: Tue, 08 Jun 2010 11:37:20 -0400
To: bug-Net-IMAP-Server <bug-net-imap-server [...] rt.cpan.org>
From: Alex Vandiver <alex [...] chmrr.net>
At Tue Jun 08 07:29:49 -0400 2010, Paul Miller via RT wrote: Show quoted text
> No such luck, that %n just adds a newline before the space before the 8.
Ugh, whoops. I added the %n to the wrong format. Try a7f5e24, which I just pushed? - Alex -- Networking -- only one letter away from not working
On Tue Jun 08 11:37:27 2010, alex@chmrr.net wrote: Show quoted text
> Ugh, whoops. I added the %n to the wrong format. Try a7f5e24, which > I just pushed? > - Alex
Ahh, now we're cookin'. All my tests pass with an exact rsync copy in my inc/ dir. -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Subject: Re: [rt.cpan.org #58160] ugh, datetimeparsing
Date: Tue, 08 Jun 2010 14:13:47 -0400
To: bug-Net-IMAP-Server <bug-net-imap-server [...] rt.cpan.org>
From: Alex Vandiver <alex [...] chmrr.net>
At Tue Jun 08 14:04:32 -0400 2010, Paul Miller via RT wrote: Show quoted text
> Ahh, now we're cookin'. All my tests pass with an exact rsync copy in > my inc/ dir.
Excellent; I'll release 1.28 shortly. - Alex -- Networking -- only one letter away from not working
On Tue Jun 08 14:13:55 2010, alex@chmrr.net wrote: Show quoted text
> At Tue Jun 08 14:04:32 -0400 2010, Paul Miller via RT wrote:
> > Ahh, now we're cookin'. All my tests pass with an exact rsync copy in > > my inc/ dir.
> > Excellent; I'll release 1.28 shortly. > - Alex
Haha, it broke again (date has two digits); apparently the %n has to be at least one space. :( Maybe we need to convince the DateTime author to make %e accept " 5" or "5" so "%e" is enough to get either? Else maybe trimming the space off the $value is better than using %n? -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
I wrote a test for it. Seems silly this is the only thing that's tested, but it at least illuminates the problem programatically. http://github.com/bestpractical/net-imap-server/network -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Subject: Re: [rt.cpan.org #58160] ugh, datetimeparsing
Date: Wed, 16 Jun 2010 14:04:29 -0400
To: bug-Net-IMAP-Server <bug-net-imap-server [...] rt.cpan.org>
From: Alex Vandiver <alex [...] chmrr.net>
At Sun Jun 13 09:10:57 -0400 2010, Paul Miller via RT wrote: Show quoted text
> Maybe we need to convince the DateTime author to make %e accept " 5" or > "5" so "%e" is enough to get either? Else maybe trimming the space off > the $value is better than using %n?
Punted upstream as https://rt.cpan.org/Public/Bug/Display.html?id=58459 - Alex -- Networking -- only one letter away from not working