mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Close #18109: os.uname() now decodes fields from the locale encoding, and
socket.gethostname() now decodes the hostname from the locale encoding, instead of using the UTF-8 encoding in strict mode.
This commit is contained in:
parent
caa00fec19
commit
a534fc4b3b
3 changed files with 14 additions and 10 deletions
|
@ -4514,7 +4514,7 @@ posix_uname(PyObject *self, PyObject *noargs)
|
|||
|
||||
#define SET(i, field) \
|
||||
{ \
|
||||
PyObject *o = PyUnicode_DecodeASCII(field, strlen(field), NULL); \
|
||||
PyObject *o = PyUnicode_DecodeFSDefault(field); \
|
||||
if (!o) { \
|
||||
Py_DECREF(value); \
|
||||
return NULL; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue