[issue17683] socket.getsockname() inconsistent return type with AF_UNIX

Charles-François Natali report at bugs.python.org
Thu May 23 19:05:11 CEST 2013


Charles-François Natali added the comment:

> Shouldn't the surrogateescape error handler (PEP 383) prevent this?

Yes, it shoud (I just read PEP 383, I told you I didn't know anything
about encoding :-).

So basically, for the test failure, the issue is simply that the
platform's default encoding can't encode character '\xff'.

Should I simply remove the offending character from this test address?

Also, let's say I wanted to test that it can be passed and returned
properly, so I add '\0xff' to the adress passed to testBytesName:

s.bind(b"\x00python\x00test\xff")

How should I check the string returned by getsockname()?

self.assertEquals(s.getsockname(), ???)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17683>
_______________________________________


More information about the Python-bugs-list mailing list