mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #17683: socket module: return AF_UNIX addresses in Linux abstract
namespace as string.
This commit is contained in:
parent
87ff387254
commit
c7c333d25d
3 changed files with 10 additions and 7 deletions
|
@ -1018,7 +1018,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
|
|||
#ifdef linux
|
||||
if (a->sun_path[0] == 0) { /* Linux abstract namespace */
|
||||
addrlen -= offsetof(struct sockaddr_un, sun_path);
|
||||
return PyBytes_FromStringAndSize(a->sun_path, addrlen);
|
||||
return PyUnicode_DecodeFSDefaultAndSize(a->sun_path, addrlen);
|
||||
}
|
||||
else
|
||||
#endif /* linux */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue