Skip to content

fix: explicitly import dateutil.parser submodule#96

Merged
philnewm merged 1 commit into
python-morgan:mainfrom
RISEFX:fix/dateutil-parser-import
Jul 20, 2026
Merged

fix: explicitly import dateutil.parser submodule#96
philnewm merged 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

@philnewm philnewm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer this explicit approach too

@philnewm
philnewm merged commit ac4b779 into python-morgan:main Jul 20, 2026
10 checks passed
@grische
grische deleted the fix/dateutil-parser-import branch July 20, 2026 14:34
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.

2 participants