-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add even more ways to populate localinterfaces #4305
Conversation
also typically faster and more reliable than gethostbyname, but lower priority than netifaces.
This branch solves my startup problems both with and without netifaces installed. |
return _load_ips_ifconfig() | ||
except (IOError, NoIPAddresses): | ||
pass | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the need of if os.name == 'nt':
here if what are in the 2 cases are ~ same for the first block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ipconfig (Windows only) and ifconfig (non-Windows), not the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes... hard to spot.
Thanks.
+1 |
As discussed in hangout, Min will try on other os like solaris...etc. |
works on OpenIndiana (successor to OpenSolaris), FreeBSD, OpenSUSE, etc. Seems safe. |
great, merging soon if no objection from anyone. |
Add even more ways to populate localinterfaces use netifaces for faster IPython.utils.localinterfaces when availlable, Parse subprocess output from ifconfig / ip addr / ipconfig. Lower priority than netifaces, but still higher priority than socket.gethostbyname. Fallback to gethostname otherwise. Should be much faster in worst case scenario where machine are badly configurred and can wait up to ~30s to start ipython. Slighly slower in other cases.
Add even more ways to populate localinterfaces use netifaces for faster IPython.utils.localinterfaces when availlable, Parse subprocess output from ifconfig / ip addr / ipconfig. Lower priority than netifaces, but still higher priority than socket.gethostbyname. Fallback to gethostname otherwise. Should be much faster in worst case scenario where machine are badly configurred and can wait up to ~30s to start ipython. Slighly slower in other cases.
Parse subprocess output from
ifconfig
/ip addr
/ipconfig
.Lower priority than
netifaces
, but still higher priority thansocket.gethostbyname
.More elaborate alternative to #4304