test_urllib2net fails in Python-3.13.11
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com Lib/test/test_urllib2net.py, especialmente TimeoutTest.test_ftp_basic, test_ftp_default_timeout, test_ftp_no_timeout e test_ftp_timeout. Execute test_urllib2net para reproduzir os quatro erros e compare o acesso com falha a HTTPResponse com o PR vinculado gh-143506. Está concluído quando esses testes passarem no Python 3.13.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- networking
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 20/100