Issue1049
Created on 2007-08-28 23:46 by janssen, last changed 2008-04-10 12:40 by trent.
|
msg55390 - (view) |
Author: Bill Janssen (janssen) |
Date: 2007-08-28 23:46 |
|
The behavior and return value for calling socket.socket.getsockname() on
an unconnected unbound socket is unspecified. On UNIX, it returns an
address ('0.0.0.0', 0), while on Windows it raises an obscure exception
"error: (10022, 'Invalid argument')". This should be regularized; I'd
suggest returning None if there is no name (address) for the socket.
|
|
msg55425 - (view) |
Author: Martin v. Löwis (loewis) |
Date: 2007-08-29 16:48 |
|
I think it is neither possible nor "good" to produce a uniform result.
Python traditionally exposes APIs "as-is", providing the system actually
has an API with the same name. It never tries to hide differing system
behaviors in the Python wrapper; if systems vary and it is desirable to
provide a uniform API, a different API is added.
However, it is also not possible to make that uniform, as getsockname(3)
gives an unspecified result, so it is not possible for Python to
actually determine whether there was a meaningful result.
Closing as rejected.
|
|
msg65280 - (view) |
Author: Bill Janssen (janssen) |
Date: 2008-04-09 23:28 |
|
Here's what the OS X man page says:
The getsockname() function returns the value 0 if successful; otherwise
the value -1 is returned and the global variable errno is set to
indicate the error.
|
|
| Date |
User |
Action |
Args |
| 2008-04-10 12:40:08 | trent | set | nosy:
+ trent |
| 2008-04-09 23:28:18 | janssen | set | messages:
+ msg65280 |
| 2007-08-29 16:48:05 | loewis | set | status: open -> closed resolution: rejected messages:
+ msg55425 nosy:
+ loewis |
| 2007-08-28 23:46:32 | janssen | create | |
|