Message119929
| Author |
loewis |
| Recipients |
baikie, ezio.melotti, jesterKing, lemburg, loewis, r.david.murray, vstinner |
| Date |
2010年10月29日.19:31:46 |
| SpamBayes Score |
2.220446e-16 |
| Marked as misclassified |
No |
| Message-id |
<1288380709.74.0.466886933256.issue9377@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The Solaris case then is already supported, with no change required: if Solaris bans non-ASCII in the network configuration (or, rather, recommends to use IDNA), then this will work fine with the current code.
The Josefsson AI_IDN flag is irrelevant to Python, IMO: it treats byte names as locale-encoded, and converts them with IDNA. Python 3 users really should use Unicode strings in the first place for non-ASCII data, in which case the socket.getaddrinfo uses IDNA, anyway. However, it can't hurt to expose this flag if the underlying C library supports it. AI_CANONIDN might be interesting to implement, but I'd rather wait whether this finds RFC approval. In any case, undoing IDNA is orthogonal to this issue (which is about non-ASCII data returned from the socket API).
If anything needs to be done on Unix, I think that the gethostname result should be decoded using the file system encoding; I then don't mind using surrogate escape there for good measure. This won't hurt systems that restrict host names to ASCII, and may do some good for systems that don't. |
|