X Tutup
The Wayback Machine - https://web.archive.org/web/20230306105400/https://github.com/python/cpython/issues/102423
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_urllib2_localnet fails in macOS 13.1 #102423

Open
uyw4687 opened this issue Mar 4, 2023 · 1 comment
Open

test_urllib2_localnet fails in macOS 13.1 #102423

uyw4687 opened this issue Mar 4, 2023 · 1 comment
Labels
OS-mac pending The issue will be closed if no feedback is provided tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@uyw4687
Copy link
Contributor

uyw4687 commented Mar 4, 2023

Bug report

A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.

test_urllib2_localnet fails in macOS 13.1

Your environment

  • CPython versions tested on: main branch(7c106a4)
  • Operating system and architecture: macOS 13.1 Apple M1 Pro
    I followed python dev guide from brew install to compile.

log of make test

0:02:37 load avg: 9.04 [432/434/2] test_tokenize passed (40.0 sec) -- running: test_multiprocessing_spawn (1 min 40 sec), test_math (51.7 sec)
0:02:47 load avg: 8.10 [433/434/2] test_multiprocessing_spawn passed (1 min 49 sec) -- running: test_math (1 min 1 sec)
0:02:57 load avg: 7.61 [434/434/2] test_math passed (1 min 10 sec)

== Tests result: FAILURE ==

411 tests OK.

2 tests failed:
    test_tools test_urllib2_localnet

21 tests skipped:
    test_check_c_globals test_devpoll test_epoll test_gdb test_ioctl
    test_launcher test_msilib test_multiprocessing_fork
    test_ossaudiodev test_peg_generator test_perf_profiler test_spwd
    test_startfile test_tix test_tkinter test_ttk test_winconsoleio
    test_winreg test_winsound test_wmi test_zipfile64
0:02:57 load avg: 7.61
0:02:57 load avg: 7.61 Re-running failed tests in verbose mode
0:02:57 load avg: 7.61 Re-running test_urllib2_localnet in verbose mode (matching: test_proxy_qop_auth_works, test_proxy_with_bad_password_raises_httperror, test_proxy_with_no_password_raises_httperror)
test_proxy_qop_auth_works (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_qop_auth_works) ... ERROR
test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_bad_password_raises_httperror) ... ERROR
test_proxy_with_no_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_no_password_raises_httperror) ... ERROR

======================================================================
ERROR: test_proxy_qop_auth_works (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_qop_auth_works)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 985, in send
    self.connect()
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 951, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 852, in create_connection
    raise exceptions[0]
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 837, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/test/test_urllib2_localnet.py", line 380, in test_proxy_qop_auth_works
    with self.opener.open(self.URL) as result:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1373, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 61] Connection refused>

======================================================================
ERROR: test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_bad_password_raises_httperror)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 985, in send
    self.connect()
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 951, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 852, in create_connection
    raise exceptions[0]
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 837, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/test/test_urllib2_localnet.py", line 366, in test_proxy_with_bad_password_raises_httperror
    self.assertRaises(urllib.error.HTTPError,
  File "/Users/user/PycharmProjects/cpython/Lib/unittest/case.py", line 766, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/unittest/case.py", line 237, in handle
    callable_obj(*args, **kwargs)
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1373, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 61] Connection refused>

======================================================================
ERROR: test_proxy_with_no_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_no_password_raises_httperror)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 985, in send
    self.connect()
  File "/Users/user/PycharmProjects/cpython/Lib/http/client.py", line 951, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 852, in create_connection
    raise exceptions[0]
  File "/Users/user/PycharmProjects/cpython/Lib/socket.py", line 837, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/PycharmProjects/cpython/Lib/test/test_urllib2_localnet.py", line 372, in test_proxy_with_no_password_raises_httperror
    self.assertRaises(urllib.error.HTTPError,
  File "/Users/user/PycharmProjects/cpython/Lib/unittest/case.py", line 766, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/unittest/case.py", line 237, in handle
    callable_obj(*args, **kwargs)
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1373, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/PycharmProjects/cpython/Lib/urllib/request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 61] Connection refused>

----------------------------------------------------------------------
Ran 3 tests in 0.311s

FAILED (errors=3)
test test_urllib2_localnet failed
0:02:57 load avg: 7.61 Re-running test_tools in verbose mode (matching: test_freeze_simple_script)
test_freeze_simple_script (test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script) ... creating the script to be frozen at /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/app.py
copying the source tree into /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/cpython...
configuring python in /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/python-build...
building python parallel='-j6' in /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/python-build...
installing python into /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/python-installation...
freezing /private/var/folders/gw/qbl1jnf1401320_xg5wv_3740000gn/T/tmpsr1kia6l/app.py...
ok

----------------------------------------------------------------------
Ran 1 test in 103.133s

OK
1 test failed again:
    test_urllib2_localnet

== Tests result: FAILURE then FAILURE ==

412 tests OK.

1 test failed:
    test_urllib2_localnet

21 tests skipped:
    test_check_c_globals test_devpoll test_epoll test_gdb test_ioctl
    test_launcher test_msilib test_multiprocessing_fork
    test_ossaudiodev test_peg_generator test_perf_profiler test_spwd
    test_startfile test_tix test_tkinter test_ttk test_winconsoleio
    test_winreg test_winsound test_wmi test_zipfile64

2 re-run tests:
    test_tools test_urllib2_localnet

Total duration: 4 min 40 sec
Tests result: FAILURE then FAILURE
make: *** [test] Error 2
@uyw4687 uyw4687 added the type-bug An unexpected behavior, bug, or error label Mar 4, 2023
@arhadthedev arhadthedev added tests Tests in the Lib/test dir OS-mac labels Mar 4, 2023
@hugovk
Copy link
Member

hugovk commented Mar 4, 2023

I just tried twice (macOS Ventura 13.2.1, Apple M1 Pro) and it passed both times.

urllib.error.URLError: <urlopen error [Errno 61] Connection refused> is probably just a temporary network error, want to try again?

@hugovk hugovk added the pending The issue will be closed if no feedback is provided label Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac pending The issue will be closed if no feedback is provided tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
X Tutup