Skip to content

Commit 58fa39b

Browse files
authored
Merge branch '3.11' into backport-5aaf416-3.11
2 parents fb09ca7 + 45db419 commit 58fa39b

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: |
4141
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
4242
# Because alternate versions are not symlinked into place by default:
43-
brew link tcl-tk@8
43+
brew link --overwrite tcl-tk@8
4444
- name: Configure CPython
4545
run: |
4646
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

Lib/test/test_socket.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
# test unicode string and carriage return
4444
MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8')
4545

46+
VMADDR_CID_LOCAL = 1
4647
VSOCKPORT = 1234
4748
AIX = platform.system() == "AIX"
4849
WSL = "microsoft-standard-WSL" in platform.release()
@@ -127,8 +128,8 @@ def _have_socket_qipcrtr():
127128

128129
def _have_socket_vsock():
129130
"""Check whether AF_VSOCK sockets are supported on this host."""
130-
ret = get_cid() is not None
131-
return ret
131+
cid = get_cid()
132+
return (cid is not None)
132133

133134

134135
def _have_socket_bluetooth():
@@ -471,8 +472,6 @@ def clientTearDown(self):
471472
@unittest.skipIf(WSL, 'VSOCK does not work on Microsoft WSL')
472473
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
473474
'VSOCK sockets required for this test.')
474-
@unittest.skipUnless(get_cid() != 2,
475-
"This test can only be run on a virtual guest.")
476475
class ThreadedVSOCKSocketStreamTest(unittest.TestCase, ThreadableTest):
477476

478477
def __init__(self, methodName='runTest'):
@@ -494,10 +493,16 @@ def clientSetUp(self):
494493
self.cli = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
495494
self.addCleanup(self.cli.close)
496495
cid = get_cid()
496+
if cid in (socket.VMADDR_CID_HOST, socket.VMADDR_CID_ANY):
497+
# gh-119461: Use the local communication address (loopback)
498+
cid = VMADDR_CID_LOCAL
497499
self.cli.connect((cid, VSOCKPORT))
498500

499501
def testStream(self):
500-
msg = self.conn.recv(1024)
502+
try:
503+
msg = self.conn.recv(1024)
504+
except PermissionError as exc:
505+
self.skipTest(repr(exc))
501506
self.assertEqual(msg, MSG)
502507

503508
def _testStream(self):

Misc/NEWS.d/3.10.0b1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ result from ``entry_points()`` as deprecated.
941941

942942
..
943943
944-
.. gh: 47383
944+
.. gh-issue: 47383
945945
.. date: 2021-04-08-19-32-26
946946
.. nonce: YI1hdL
947947
.. section: Library

Misc/NEWS.d/3.11.0b1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ planned). Patch by Alex Waygood.
570570

571571
..
572572
573-
.. gh: 78157
573+
.. gh-issue: 78157
574574
.. date: 2022-05-05-20-40-45
575575
.. nonce: IA_9na
576576
.. section: Library
@@ -1288,7 +1288,7 @@ Deprecate the chunk module.
12881288

12891289
..
12901290
1291-
.. gh: 91498
1291+
.. gh-issue: 91498
12921292
.. date: 2022-04-10-08-39-44
12931293
.. nonce: 8oII92
12941294
.. section: Library

0 commit comments

Comments
 (0)