Skip to content

fix: explicitly import dateutil.parser submodule#96

Open
grische wants to merge 1 commit into
python-morgan:mainfrom
RISEFX:fix/dateutil-parser-import
Open

fix: explicitly import dateutil.parser submodule#96
grische wants to merge 1 commit into
python-morgan:mainfrom
RISEFX:fix/dateutil-parser-import

Conversation

@grische

@grische grische commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

"import dateutil" does not import the parser submodule; accessing dateutil.parser only works on python-dateutil >= 2.9, which added lazy submodule imports via module getattr. With older versions, every touch_file() call (i.e. every downloaded file) crashes with AttributeError since python-dateutil is not pinned. Import the submodule explicitly, which works on all versions.

"import dateutil" does not import the parser submodule; accessing
dateutil.parser only works on python-dateutil >= 2.9, which added lazy
submodule imports via module __getattr__. With older versions, every
touch_file() call (i.e. every downloaded file) crashes with
AttributeError since python-dateutil is not pinned. Import the
submodule explicitly, which works on all versions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@grische
grische force-pushed the fix/dateutil-parser-import branch from ca061dd to 6163198 Compare July 17, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant