Use timezone-aware datetime.datetime.now()
Replace deprecated datetime.datetime.utcnow() with timezone-aware datetime.datetime.now()
This change addresses a deprecation warning for python 3.12 by using datetime.datetime.now() with datetime.timezone.utc, ensuring the timestamp remains in UTC and conforms to newer best practices.
Works for me too
➜ ~ curl https://raw.githubusercontent.com/4n3w/speedtest-cli/fix_datetime_utcnow_deprecation/speedtest.py | python3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 65352 100 65352 0 0 263k 0 --:--:-- --:--:-- --:--:-- 263k
Retrieving speedtest.net configuration...
Testing from Spectrum (a.b.c.d)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Airlink Internet Inc (Los Angeles, CA) [167.30 km]: 20.176 ms
Testing download speed................................................................................
Download: 196.26 Mbit/s
Testing upload speed......................................................................................................
Upload: 10.62 Mbit/s
I guess someone with write access would have to merge this, summoning @sivel
you should update that too
duplicate of #801 (and would be included in #799 also)?
hey guys, just FYI this is still a thing:
Really?
On Sat, 8 Feb 2025, 3:22 am Teodor Daskalov, @.***> wrote:
hey guys, just FYI this is still a thing: image.png (view on web) https://github.com/user-attachments/assets/04399604-3804-4e85-961f-6c402c32075d
— Reply to this email directly, view it on GitHub https://github.com/sivel/speedtest-cli/pull/805#issuecomment-2644559952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWTMNNRM7WUC3ZQ4JYBM3O32OWWB3AVCNFSM6AAAAABGE2F4MGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBUGU2TSOJVGI . You are receiving this because you commented.Message ID: @.***>