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

fix hostname -I for macOS #6497 #6990

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fitzjalen
Copy link

@fitzjalen fitzjalen commented Feb 2, 2025

BUGFIX for Apple Silicon hostname #6497

BUGFIX for Apple Silicon hostname
master_addr = result.decode('utf-8').split()[0]
except subprocess.CalledProcessError: # hostname -I not available (e.g. on macOS)
import socket
master_addr = socket.gethostbyname(socket.gethostname())
Copy link
Collaborator

@loadams loadams Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fitzjalen - wanted to check that this is working for you, I get different results when running this:

hostname -I
172.28.29.141

vs

>>> import socket
>>> socket.gethostbyname(socket.gethostname())
'127.0.1.1'

Could you share the output of these that it is working on your system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants