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

PytzUsageWarning: localize method no longer necessary #271

Closed
rwinterschlaf opened this issue Dec 1, 2022 · 2 comments
Closed

PytzUsageWarning: localize method no longer necessary #271

rwinterschlaf opened this issue Dec 1, 2022 · 2 comments
Labels
question Further information is requested

Comments

@rwinterschlaf
Copy link

...\python37\lib\site-packages\dateparser\date_parser.py:35: 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)

Received the above warning when trafilatura comes across https://www.badische-zeitung.de/nachrichten/wetter. It doesn't seem to be relevant on other websites and has no impact on the functionality, but is a bit annoying to see pop up from time to time.

@adbar adbar added the question Further information is requested label Dec 1, 2022
@adbar
Copy link
Owner

adbar commented Dec 1, 2022

Hi @rwinterschlaf, I also came across it, it's related to the dateparser module, updating it to version 1.1.2 should remove the warning: scrapinghub/dateparser#1089

The latest htmldate version (package for date extraction) accounts for it too. Also, using the last dateparser version (1.1.4) could lead to more improvements but seems to be slower on my data, so use it at your own discretion.

@rwinterschlaf
Copy link
Author

Wonderful, worked like a charm! I'll keep an eye on the speed - thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants