python / python/cpython

test_urllib2net fails in Python-3.13.11

Đang mở
#143,507 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

tests type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với Lib/test/test_urllib2net.py, đặc biệt là TimeoutTest.test_ftp_basic, test_ftp_default_timeout, test_ftp_no_timeout và test_ftp_timeout. Chạy test_urllib2net để tái hiện bốn lỗi và so sánh việc truy cập HTTPResponse bị lỗi với PR được liên kết gh-143506. Hoàn tất khi các kiểm thử này vượt qua trên Python 3.13.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
networking
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.