-
Notifications
You must be signed in to change notification settings - Fork 467
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
PytzUsageWarning: The localize method is no longer necessary #1089
Comments
It should be fixed in 1.1.2, released today. Please, see if you can reproduce the issue with 1.1.2. |
👋 I can reproduce this on 1.1.4 with import dateparser
from datetime import datetime
dateparser.parse(
"in 3 hours",
settings={
"TO_TIMEZONE": "UTC",
"RELATIVE_BASE": datetime.now(),
},
) I'm on Python 3.8 |
@madkinsz yeah interestingly I can also reproduce it on python 3.11 with dateparser 1.1.4 |
I did some digging. As of writing,
dateparser/dateparser/freshness_date_parser.py Lines 40 to 41 in 7b469b1
dateparser/dateparser/freshness_date_parser.py Lines 74 to 76 in 7b469b1
As And since |
Full Usage warning:
PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html date_obj = stz.localize(date_obj)
Line 35 in date_parser.py
Occurs when parsing this here: "2022-10-03 22:00:00"
Python Version:
3.9.1
The text was updated successfully, but these errors were encountered: