Conan: Bug: `dateutil.parser.isoparse` is not available until dateutil>=2.7.0

Created on 13 Jul 2019  路  2Comments  路  Source: conan-io/conan

The function dateutil.parse.isoparse only became available in python-dateutil 2.7.0, while the current dependency is specified at 2.6.0 or greater.

I only so far encounter this when using conan search <ref> -rev (the -rev attempts to parse an ISO8601 time string). This won't occur on brand-new installations as Pip will automatically pick a newer python-dateutil. Upgraded installations with dateutil<2.7.0 will see this exception:

Traceback (most recent call last):
  File "/some/path/conan/conans/client/command.py", line 1848, in run
    method(args[0][1:])
  File "/some/path/conan/conans/client/command.py", line 1214, in search
    self._outputer.print_revisions(ref, info, remote_name=args.remote)
  File "/some/path/conan/conans/client/conan_command_output.py", line 242, in print_revisions
    for r in revisions]
  File "/some/path/conan/conans/client/conan_command_output.py", line 242, in <listcomp>
    for r in revisions]
  File "/some/path/conan/conans/util/dates.py", line 14, in iso8601_to_str
    dt = from_iso8601_to_datetime(iso_str)
  File "/some/path/conan/conans/util/dates.py", line 10, in from_iso8601_to_datetime
    return parser.isoparse(iso_str)
AttributeError: module 'dateutil.parser' has no attribute 'isoparse'

This looks to have been added in e7bf709548b59b015bf2b918a785bbb9160c7609 and is present in 1.18.0.dev (f1755997ff5ad9e36bd6bce937684a9e864b0aa4). Simple PR incoming.

low high bug

Most helpful comment

If anyone stumbles in: The simple fix is to upgrade python-dateutil to 2.7.0 or newer.

All 2 comments

If anyone stumbles in: The simple fix is to upgrade python-dateutil to 2.7.0 or newer.

Fixed in #5485, will be released in 1.17.1

Was this page helpful?
0 / 5 - 0 ratings