Skip to content

datetime.datetime.utcnow() is deprecated since Python 3.12 #913

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

Open
Lisias opened this issue Aug 18, 2024 · 2 comments
Open

datetime.datetime.utcnow() is deprecated since Python 3.12 #913

Lisias opened this issue Aug 18, 2024 · 2 comments
Assignees

Comments

@Lisias
Copy link

Lisias commented Aug 18, 2024

I'm running pywb on Python 3.12 nowadays, and I had noticed the following message on the logs now and then:

Deprecated since version 3.12: Use datetime.now() with UTC instead.

Researching about, I learnt that datetime.datetime.utcnow() is being deprecated - if I understood correctly, naive datetimes are going to be avoided.

Since is unavoidable that utcnow() will be removed from the Python's library, I consider prudent to prevent users from being caught by surprise in the foreseeable future.

@Lisias
Copy link
Author

Lisias commented Mar 17, 2025

Hi, @tw4l .

I updated #914

WARCIO is now on version 1.7.5 where the option to get tz aware datetimes from the warcio.timeutils are implemented. I code reviewed my pull request to be sure these changes would not end up with mixed awareness on the same code. To the best of my knowledge, it will not.

I'm in the process of updating my appliance to the canon WARCIO, replacing my bootlegged interim one and then validate these pywb changes with it in a "production" environment.

I will update this issue with results in a way or another.

@Lisias
Copy link
Author

Lisias commented Mar 18, 2025

Done. All my processes were rebooted using WARCIO 1.7.5 and PYWB with the patches from this pull request applied.

Everything still work as intended.

@tw4l tw4l moved this from Todo to Ready in Webrecorder Projects Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants