`LogRecord` should normalize falsy `exc_info` values
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza en Lib/logging/init.py, en la ruta de llamada de logging citada en el issue, donde exc_info se normaliza antes de makeRecord. Revisa las pruebas de logging pertinentes y añade cobertura para valores falsy de exc_info, como False y None. El trabajo estará terminado cuando los valores falsy lleguen a LogRecord como None y las pruebas pasen.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Pointed out by @tjkuson in python/typeshed#16466
According to the documentation, the exc_info argument to the log() group of function can be any falsy value to indicate that no exception information is provided. It's common to use either None or False here.
When a truthy value is provided, it is normalized to an exception info tuple before passing it to LogRecord. A falsy value is passed on unchanged:
This contradicts LogRecords documentation, which says that only None is accepted and that the exc_info field can be a tuple or None. The mypy primer run in python/typeshed#16466 shows that a few projects make this assumption. For example, sphinx:
if record.exc_info is not None:
raise SphinxWarning(message) from record.exc_info[1]
Solution: Normalize falsy values to None before passing them to makeRecord.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-158840
- Lenguaje dominante
- Python
- Estrellas
- 77.6k
- Forks
- 37.6k
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 612
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
Docs: problem with page "msvcrt — Useful routines from the MS VC runtime"Posiblemente ocupada @jikekei la tomó hace 3 días. Abiertodocs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
python/cpython#159072 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
-
Document unpacking in generator expressions (PEP 798)Posiblemente ocupada @Marwan-verse la tomó hoy. Abiertodocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
python/cpython#159061 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`http.client.HTTPSConnection._tunnel` raises `AttributeError: 'NoneType' object has no attribute 'encode'` when header value is `None`Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto3.14 3.15 3.16 stdlib type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
python/cpython#159044 · 17 comentarios ·
Los mantenedores suelen responder en 1 día
-
A minor problem with the section "6.10.2. Membership test operations" from the language reference.Abiertodocs pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#159034 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Docs: socket.htons() and friends raise ValueError for negative input since 3.14Posiblemente ocupada @vetrovk la tomó hace 4 días. Abiertodocs topic-socket
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
python/cpython#159012 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
topoteretes/cognee#5773 ·
Los mantenedores suelen responder en 1 día
-
MiKTeX: a failed build reports no errors because texify --quiet switches the log to file:line: styleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
SublimeText/LaTeXTools#1718 ·