-
Notifications
You must be signed in to change notification settings - Fork 650
BUG: socket.bind('tcp://127.0.0.1:...')
fails with ZMQError: Invalid argument on macOS ARM with pyzmq 26.4.0
#2093
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
Comments
I am seeing the same error with both
I don't see the error on other versions of Windows. |
This is my output from @itsmevictor's script (also arm mac, homebrew Python 3.11):
Did you get pyzmq from a wheel or compile from source? Do other local addresses work, e.g.
Does any 26.x work, or only 25.x? Here's a script that lets you try more things at once: import platform
import time
import zmq
print(f"pyzmq version: {zmq.pyzmq_version()}")
print(f"libzmq version: {zmq.zmq_version()}")
print(f"Python version: {platform.python_version()}")
print(f"OS: {platform.system()} {platform.release()} ({platform.machine()})")
with zmq.Context() as ctx:
for address in [
'tcp://localhost:9027',
'tcp://127.0.0.1:9027',
'tcp://0.0.0.0:9027',
'tcp://*:9027',
'tcp://127.0.0.1:65500',
]:
with ctx.socket(zmq.REP) as sock:
time.sleep(0.2)
try:
print(f"Attempting to bind to {address}...")
sock.bind(address)
print("Bind successful!")
except zmq.error.ZMQError as e:
print(f"Bind failed: {e}") # This is where the error occurs
except Exception as e:
print(f"An unexpected error occurred: {e}") |
Thanks for your quick response @minrk. I'm not going to be able to perform further testing (i.e. uninstalling 25.x, installing 26.x) right now, but to answer your questions in the meantime:
I'll try to conduct further testing tomorrow. |
Seeing the same thing on windows, but only when running in the vscode debugger for some reason. Edit: Downgrading to 26.3.0 worked. |
Seeing similar error on linux with ipc socket:
It disappears when downgrading to 26.3.0. |
Im also having this issue on an M1 Max running Sequoia 15.5. Downgrading to 26.3 has fixed it for me. |
Uh oh!
There was an error while loading. Please reload this page.
This is a pyzmq bug
What pyzmq version?
26.4.0
What libzmq version?
4.3.5_1 (Installed separately via Homebrew)
Python version (and how it was installed)
Python 3.11.12 (Installed via Homebrew)
OS
macOS Sequoia
What happened?
Summary:
When using pyzmq version 26.4.0 on macOS ARM with Python 3.11 (installed via Homebrew) and libzmq 4.3.5_1 (also installed via Homebrew), attempting to bind a socket to a localhost TCP address fails with
zmq.error.ZMQError: Invalid argument.
Expected behavior:
The
socket.bind('tcp://127.0.0.1:<port>')
call should succeed without raising an exception.Actual behavior:
The call raises the following exception:
zmq.error.ZMQError: Invalid argument (addr='tcp://127.0.0.1:<port>')
Code to reproduce bug
Finally, reverting to
25.1.2
solved the issue.The text was updated successfully, but these errors were encountered: