python / python/cpython

`_utcfromtimestamp` is undefined in `datetimetester`

Abierto
#120,266 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@sobolevn ya está trabajando en esto.

Desde el 8/6/2024.

tests type-bug
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.