New submission from Arfrever Frehtes Taifersar Arahesis:

Documentation (in Python 3.3) says that None is returned when date cannot be 
parsed.

In Python 3.2:

>>> email.utils.parsedate("0")
>>> email.utils.parsedate_tz("0")
>>>

In Python 3.3:

>>> email.utils.parsedate("0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.3/email/utils.py", line 232, in parsedate
    return _parsedate(data)
  File "/usr/lib64/python3.3/email/_parseaddr.py", line 172, in parsedate
    t = parsedate_tz(data)
  File "/usr/lib64/python3.3/email/_parseaddr.py", line 51, in parsedate_tz
    if res[9] is None:
TypeError: 'NoneType' object is not subscriptable
>>> email.utils.parsedate_tz("0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.3/email/utils.py", line 238, in parsedate_tz
    return _parsedate_tz(data)
  File "/usr/lib64/python3.3/email/_parseaddr.py", line 51, in parsedate_tz
    if res[9] is None:
TypeError: 'NoneType' object is not subscriptable
>>> email.utils.parsedate_to_datetime("0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.3/email/utils.py", line 243, in parsedate_to_datetime
    *dtuple, tz = __parsedate_tz(data)
TypeError: 'NoneType' object is not iterable
>>>

----------
messages: 170347
nosy: Arfrever
priority: release blocker
severity: normal
status: open
title: email.utils.parsedate(), email.utils.parsedate_tz() and 
email.utils.parsedate_to_datetime() should return None when date cannot be 
parsed
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15925>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to