Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'datetime.timezone'; 'datetime' is not a package #172

Closed
valberg opened this issue Aug 17, 2022 · 2 comments · Fixed by #174
Closed

Comments

@valberg
Copy link

valberg commented Aug 17, 2022

Python Version

3.10

Django Version

4.1

Package Version

1.8.0

Description

After running the new 1.8.0 my project now throws this error:

>>> from datetime.timezone import utc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'datetime.timezone'; 'datetime' is not a package

I guess #169 was a bit too eager since timezone.utc is just an attribute on timezone and thus not importable.

@adamchainz
Copy link
Owner

Thank you for the report, I guess we both missed that 😅

Fixed in #174, released in 1.8.1!

@hramezani you may want to check my PR, perhaps there's another case it doesn't fix.

@hramezani
Copy link
Contributor

Thanks @valberg for reporting. Yes, we missed that.

@adamchainz Thanks for taking care. LGTM 👍

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 a pull request may close this issue.

3 participants