Page MenuHomePhabricator

datetime.utcnow(), utcfromtimestamp() and utctimetuple() are deprecated since Python 3.12
Closed, ResolvedPublic

Description

datetime.utcnow(), utcfromtimestamp() and utctimetuple() are deprecated since Python 3.12 [1]

This results in a lot of fails due to deprecation warnings

[1] https://docs.python.org/3.12/library/datetime.html?highlight=utcnow#datetime.datetime

Event Timeline

Xqt triaged this task as High priority.May 30 2023, 1:54 PM

Change 924547 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] Python 3.12 fails due to deprectated datetime.utcnow() function

https://gerrit.wikimedia.org/r/924547

Change 924547 merged by jenkins-bot:

[pywikibot/core@master] [tests] Python 3.12 fails due to deprectated datetime.utcnow() function

https://gerrit.wikimedia.org/r/924547

Xqt renamed this task from datetime.utcnow() is deprecated since Python 3.12 to datetime.utcnow(), utcfromtimestamp() and utctimetuple() are deprecated since Python 3.12.Jun 4 2023, 1:01 PM
Xqt updated the task description. (Show Details)

Change 934697 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] add nowutc() method to pywikibot.Timestamp()

https://gerrit.wikimedia.org/r/934697

Change 934696 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [Fix] datetime.utcnow() is deprecated

https://gerrit.wikimedia.org/r/934696

Change 934697 abandoned by Xqt:

[pywikibot/core@master] [IMPR] add nowutc() method to pywikibot.Timestamp()

Reason:

https://gerrit.wikimedia.org/r/934697

Change 934696 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [Fix] datetime.utcnow() is deprecated

https://gerrit.wikimedia.org/r/934696

Change 999558 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] ignore failing macOS due to T337748

https://gerrit.wikimedia.org/r/999558

Change 999558 merged by Xqt:

[pywikibot/core@master] [tests] ignore failing macOS due to T337748

https://gerrit.wikimedia.org/r/999558

Xqt claimed this task.

Change 934696 merged by jenkins-bot:

[pywikibot/core@master] [Fix] datetime.utcnow() is deprecated; use Timestamp.nowutc() instead

https://gerrit.wikimedia.org/r/934696