Skip to content

test_urllib2net fails in Python-3.13.11 #143507

@zuhu2195

Description

@zuhu2195

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

#143506

If this is a valid issue please merge the same.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions