python / python/cpython

`_utcfromtimestamp` is undefined in `datetimetester`

Aperta
#120,266 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@sobolevn ci sta già lavorando.

Dal 8/6/2024.

tests type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Bug report

This code cannot run correctly:

https://github.com/python/cpython/blob/55402d3232ca400ebafe4fe3bd70f252304ebe07/Lib/test/datetimetester.py#L6221-L6227

Because _utcfromtimestamp is not defined anywhere.

Introduced in https://github.com/python/cpython/commit/38dc3f28dde92b4fa6284a57f4e554991a3d9276 by @pganssle

I think that this is a typo, I will send a PR.

This was introduced when datetime.utcfromtimestamp was deprecated, I propose to use a direct alternative: datetime.fromtimestamp(t, datetime.UTC)

This problem is not detected by tests, because this looks like a in-test helper for module maintainers. It is not used as of right now.

Linked PRs
  • gh-120267

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.