[ python-Bugs-1249573 ] rfc822 module, bug in parsedate_tz

2007-01-22 Thread SourceForge.net
Bugs item #1249573, was opened at 2005-08-01 13:56
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1249573group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.4
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: nemesis (nemesis_xpn)
Assigned to: Nobody/Anonymous (nobody)
Summary: rfc822 module, bug in parsedate_tz

Initial Comment:
I found that the function parsedate_tz of the rfc822
module has a bug (or at least I think so).
I found a usenet article (message-id:
[EMAIL PROTECTED])
that has this Date field:

Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct�, but parsedate_tz is not able
to decode it, it
is confused by the absence of a space after the ,.
I studied the parsedate_tz code and the problem is on
its third line:
...
if not data:
return None
data = data.split()
...
After the split I have:

['Tue,26', 'Jul', '2005', '13:14:27', 'GMT', '+0200']

but Tue, and 26 should be separated.

Of course parsedate_tz correctly decode the field if
you add a space after the ,.

A possible solution is to change the line n�863 of
rfc822.py (data=data.split()) with this one:
data=data.replace(,,, ).split()

it solves the problem and should not affect the normal
behaviour.

� and looking at rfc2822 par3.3 it should be correct,
the space after
the comma is not mandatory:

date-time   =   [ day-of-week , ] date FWS
time [CFWS]

day-of-week =   ([FWS] day-name) / obs-day-of-week

day-name=   Mon / Tue / Wed / Thu /
Fri / Sat / Sun

date=   day month year

--

Comment By: Georg Brandl (gbrandl)
Date: 2007-01-22 21:10

Message:
Logged In: YES 
user_id=849994
Originator: NO

Fixed in rev. 53522, 53523 (2.5).

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1249573group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: rfc822 module bug?

2005-08-01 Thread Nemesis
Mentre io pensavo ad una intro simpatica Tim Roberts scriveva:

[rfc822 module bug]
Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct¹, but parsedate_tz is not able to decode it, it
is confused by the absence of a space after the ,.

 Fascinating.  I've written a lot of e-mail programs, and I would have bet
 real money that this was not legal by either RFC822 or 2822, but the BNF
 certainly supports your assertion that this is valid.
[...]
 This is actually from RFC2822, but the point is the same.

Yes you are right of course.

I think I'll submit this bug on the Python web-site.

-- 
Sfugge un braccio a Pessotto. (Amedeo Goria)
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: rfc822 module bug?

2005-08-01 Thread Tony Meyer
[rfc822 module bug]
 Date: Tue,26 Jul 2005 13:14:27 GMT +0200

 It seems to be correct¹, but parsedate_tz is not able to 
 decode it, it is confused by the absence of a space after
 the ,.
[...]
 I think I'll submit this bug on the Python web-site.

Please don't.  The rfc822 module is deprecated from Python 2.3 in favour of
the email package.  This bug does not exist in the email package (at least
in Python 2.4).  For example:

 import rfc822
 rfc822.parsedate_tz(Tue, 26 Jul 2005 13:14:27 GMT +0200)
(2005, 7, 26, 13, 14, 27, 0, 1, 0, 0)
 rfc822.parsedate_tz(Tue,26 Jul 2005 13:14:27 GMT +0200)

 import email
 import email.Utils
 email.Utils.parsedate_tz(Tue, 26 Jul 2005 13:14:27 GMT +0200)
(2005, 7, 26, 13, 14, 27, 0, 1, 0, 0)
 email.Utils.parsedate_tz(Tue,26 Jul 2005 13:14:27 GMT +0200)
(2005, 7, 26, 13, 14, 27, 0, 1, 0, 0)

=Tony.Meyer

-- 
http://mail.python.org/mailman/listinfo/python-list


[ python-Bugs-1249573 ] rfc822 module, bug in parsedate_tz

2005-08-01 Thread SourceForge.net
Bugs item #1249573, was opened at 2005-08-01 15:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1249573group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: nemesis (nemesis_xpn)
Assigned to: Nobody/Anonymous (nobody)
Summary: rfc822 module, bug in parsedate_tz

Initial Comment:
I found that the function parsedate_tz of the rfc822
module has a bug (or at least I think so).
I found a usenet article (message-id:
[EMAIL PROTECTED])
that has this Date field:

Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct¹, but parsedate_tz is not able
to decode it, it
is confused by the absence of a space after the ,.
I studied the parsedate_tz code and the problem is on
its third line:
...
if not data:
return None
data = data.split()
...
After the split I have:

['Tue,26', 'Jul', '2005', '13:14:27', 'GMT', '+0200']

but Tue, and 26 should be separated.

Of course parsedate_tz correctly decode the field if
you add a space after the ,.

A possible solution is to change the line n°863 of
rfc822.py (data=data.split()) with this one:
data=data.replace(,,, ).split()

it solves the problem and should not affect the normal
behaviour.

¹ and looking at rfc2822 par3.3 it should be correct,
the space after
the comma is not mandatory:

date-time   =   [ day-of-week , ] date FWS
time [CFWS]

day-of-week =   ([FWS] day-name) / obs-day-of-week

day-name=   Mon / Tue / Wed / Thu /
Fri / Sat / Sun

date=   day month year

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1249573group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: rfc822 module bug?

2005-07-31 Thread Tim Roberts
Nemesis [EMAIL PROTECTED] wrote:

Hi all,
I found that the function parsedate_tz of the rfc822 module has a bug
(or at least I think so).
I found a usenet article (message-id: [EMAIL PROTECTED])
that has this Date field:

Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct¹, but parsedate_tz is not able to decode it, it
is confused by the absence of a space after the ,.

Fascinating.  I've written a lot of e-mail programs, and I would have bet
real money that this was not legal by either RFC822 or 2822, but the BNF
certainly supports your assertion that this is valid.

RFC1036, which gives the format for Usenet articles, includes the space in
its suggested date format.

¹ and looking at rfc822 par3.3 it should be correct:

date-time   =   [ day-of-week , ] date FWS time [CFWS]

day-of-week =   ([FWS] day-name) / obs-day-of-week

day-name=   Mon / Tue / Wed / Thu /
Fri / Sat / Sun

date=   day month year

This is actually from RFC2822, but the point is the same.
-- 
- Tim Roberts, [EMAIL PROTECTED]
  Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


rfc822 module bug?

2005-07-30 Thread Nemesis
Hi all,
I found that the function parsedate_tz of the rfc822 module has a bug
(or at least I think so).
I found a usenet article (message-id: [EMAIL PROTECTED])
that has this Date field:

Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct¹, but parsedate_tz is not able to decode it, it
is confused by the absence of a space after the ,.
I studied the parsedate_tz code and the problem is on its third line:
...
if not data:
return None
data = data.split()
...
After the split I have:

['Tue,26', 'Jul', '2005', '13:14:27', 'GMT', '+0200']

but Tue, and 26 should be separated.

Of course parsedate_tz correctly decode the field if you add a space
after the ,.

Do you think that's a bug?
Which is the most correct place where to file this bug?


¹ and looking at rfc822 par3.3 it should be correct:

date-time   =   [ day-of-week , ] date FWS time [CFWS]

day-of-week =   ([FWS] day-name) / obs-day-of-week

day-name=   Mon / Tue / Wed / Thu /
Fri / Sat / Sun

date=   day month year

-- 
A pat on the back is only a few centimeters from a kick in the butt.
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: rfc822 module bug?

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 09:08 +, Nemesis wrote:
 Hi all,
 I found that the function parsedate_tz of the rfc822 module has a bug
 (or at least I think so).
 I found a usenet article (message-id: [EMAIL PROTECTED])
 that has this Date field:
 
 Date: Tue,26 Jul 2005 13:14:27 GMT +0200

My preferred date/time module is Gustavo Niemeyer's DateUtil module:

https://moin.conectiva.com.br/DateUtil

It parses an astounding number of date formats (I used it to parse the
mess of dates and times provided by RSS feeds without a hitch).

Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


-- 
http://mail.python.org/mailman/listinfo/python-list