Message259081
| Author |
vstinner |
| Recipients |
abarry, vstinner |
| Date |
2016年01月28日.01:10:15 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1453943415.23.0.44809658142.issue26226@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Python 2.7.11:
>>> import socket
>>> socket.gethostname()
'\xc9manuel-PC'
This one works on Python 3 because the Python function is implemented with a call to the Windows native API.
>>> socket.gethostbyaddr(socket.gethostname())
('\xc9manuel-PC.home', [], ['fe80::c9b7:5117:eea4:a104'])
This one fails on Python 3 because it uses the gethostbyaddr() C function and then decodes the hostname from UTF-8, whereas the hostname looks more to be encoded to ISO 8859-1 or something like that. IMHO it should be decoded from the ANSI code page.
I opened the issue #26227 to track this bug. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年01月28日 01:10:15 | vstinner | set | recipients:
+ vstinner, abarry |
| 2016年01月28日 01:10:15 | vstinner | set | messageid: <1453943415.23.0.44809658142.issue26226@psf.upfronthosting.co.za> |
| 2016年01月28日 01:10:15 | vstinner | link | issue26226 messages |
| 2016年01月28日 01:10:15 | vstinner | create |
|