python / python/cpython

test_urllib2net fails in Python-3.13.11

Abierto
#143,507 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

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

Bug description:
======================================================================
ERROR: test_ftp_basic (test.test_urllib2net.TimeoutTest.test_ftp_basic)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/mohammed/python/Python-3.13.11/Lib/test/test_urllib2net.py", line 384, in test_ftp_basic
    self.assertIsNone(u.fp.fp.raw._sock.gettimeout())
                      ^^^^^^^
AttributeError: '_io.BufferedReader' object has no attribute 'fp'

======================================================================
ERROR: test_ftp_default_timeout (test.test_urllib2net.TimeoutTest.test_ftp_default_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/mohammed/python/Python-3.13.11/Lib/test/test_urllib2net.py", line 395, in test_ftp_default_timeout
    self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
                     ^^^^^^^
AttributeError: '_io.BufferedReader' object has no attribute 'fp'

======================================================================
ERROR: test_ftp_no_timeout (test.test_urllib2net.TimeoutTest.test_ftp_no_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/mohammed/python/Python-3.13.11/Lib/test/test_urllib2net.py", line 407, in test_ftp_no_timeout
    self.assertIsNone(u.fp.fp.raw._sock.gettimeout())
                      ^^^^^^^
AttributeError: '_io.BufferedReader' object has no attribute 'fp'

======================================================================
ERROR: test_ftp_timeout (test.test_urllib2net.TimeoutTest.test_ftp_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/mohammed/python/Python-3.13.11/Lib/test/test_urllib2net.py", line 414, in test_ftp_timeout
    self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
                     ^^^^^^^
AttributeError: '_io.BufferedReader' object has no attribute 'fp'

----------------------------------------------------------------------
Ran 16 tests in 31.503s

FAILED (errors=4, skipped=1)
test test_urllib2net failed
0:00:31 load avg: 2.49 [1/1/1] test_urllib2net failed (4 errors) in 31.7 sec

== Tests result: FAILURE ==

1 test failed:
    test_urllib2net

Total duration: 31.7 sec
Total tests: run=16 skipped=1
Total test files: run=1/1 failed=1
Result: FAILURE

I have built Python-3.13.11 from source and ran the test test_urllib2net in Linux ubuntu 6.8.0-53-generic. The test seems to fail because of typo in accessing fp from a HTTPResponse object. I have created a PR for the same

https://github.com/python/cpython/pull/143506

If this is a valid issue please merge the same.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs
  • gh-143506

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.

Línea de trabajo

Comienza con Lib/test/test_urllib2net.py, especialmente con TimeoutTest.test_ftp_basic, test_ftp_default_timeout, test_ftp_no_timeout y test_ftp_timeout. Ejecuta test_urllib2net para reproducir los cuatro errores y compara el acceso fallido a HTTPResponse con el PR vinculado gh-143506. La tarea estará terminada cuando estas pruebas pasen en Python 3.13.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
networking
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.