8.1.0 breaks parsing unicode strings with Python 2.7

Issue #28 resolved
Brandon Nielsen repo owner created an issue

The type checking logic introduced in 8.1.0 to prevent non-String data from being fed to the parse logic breaks the parsing of unicode strings in Python 2.7:

>>> parse_date('1980366')
datetime.date(1980, 12, 31)
>>> parse_date(unicode('1980366'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nielsenb/Desktop/test/lib/python2.7/site-packages/aniso8601/date.py", line 115, in parse_date
    return _RESOLUTION_MAP[get_date_resolution(isodatestr)](isodatestr,
  File "/home/nielsenb/Desktop/test/lib/python2.7/site-packages/aniso8601/date.py", line 27, in get_date_resolution
    raise ValueError('Date must be string.')
ValueError: Date must be string.

Comments (2)

  1. Log in to comment