-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix bug: incorrect network interface returned by net_io_counters(True… #670
Conversation
…) and net_if_addrs() [Bug description] When network interface contains non-ansii characters, such as Chinese characters, the network interface name returned by net_io_counters(True) and net_if_addrs() were truncated or blank string. [Solution] This fix ensures these two functions will return correct network interface names.
Since
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa366058(v=vs.85).aspx |
Hi mrjefftang, Yes, PyUnicode_FromWideChar is better, and can solve this issue.
Do you have any new comments? |
…net_if_addrs [Bug description] When network interface contains non-ansii characters, such as Chinese characters, the network interface name returned by net_io_counters(True) and net_if_addrs() were truncated or blank. [Solution] This fix ensures these two functions will return correct network interface names. Use PyUnicode_FromWideChar to fix this issue.
This looks good to me. |
Fix bug: incorrect network interface returned by net_io_counters(True…
For the record. This solves the following issues: Python 2 was not returning unicode:
Python 3 was segfaulting:
|
…) and net_if_addrs()
[Bug description]
When network interface contains non-ansii characters, such as Chinese
characters, the network interface name returned by net_io_counters(True)
and net_if_addrs() were truncated or blank string.
[Solution]
This fix ensures these two functions will return correct network
interface names.