Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934226 - sys-apps/portage: Python deprecation warnings about datetime.datetime.utcnow() with e.g. emerge --sync
Summary: sys-apps/portage: Python deprecation warnings about datetime.datetime.utcnow(...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-14 06:48 UTC by Hanno Böck
Modified: 2024-06-14 07:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck gentoo-dev 2024-06-14 06:48:54 UTC
With python 3.12 and enabed warnings, python complains about the use of datetime.datetime.utcfromtimestamp() in portage. There are warnings both about portage's own code (rsync.py) and in gemato (openpgp.py).

To reproduce:
PYTHONWARNINGS=d emerge --sync -q

Output:

/usr/lib/python3.12/site-packages/gemato/openpgp.py:171: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
  return datetime.datetime.utcfromtimestamp(int(ts))
/usr/lib/python3.12/site-packages/portage/sync/modules/rsync/rsync.py:440: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  and (datetime.datetime.utcnow() - ts.ts).days > self.max_age
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-14 06:52:17 UTC
Please file a separate bug for the gemato issue, as it lives in a separate repo and so on.