Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 41956:b30c75d22f34
Change getdefaultencoding() and getfilesystemencoding()
to return unicode strings.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Tue, 05 Jun 2007 20:15:52 +0000 |
| parents | 308e632702bf |
| children | 7015cccf29e3 |
comparison
equal
deleted
inserted
replaced
| 41955:4c5fbe65b7de | 41956:b30c75d22f34 |
|---|---|
| 212 | 212 |
| 213 | 213 |
| 214 static PyObject * | 214 static PyObject * |
| 215 sys_getdefaultencoding(PyObject *self) | 215 sys_getdefaultencoding(PyObject *self) |
| 216 { | 216 { |
| 217 return PyString_FromString(PyUnicode_GetDefaultEncoding()); | 217 return PyUnicode_FromString(PyUnicode_GetDefaultEncoding()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 PyDoc_STRVAR(getdefaultencoding_doc, | 220 PyDoc_STRVAR(getdefaultencoding_doc, |
| 221 "getdefaultencoding() -> string\n\ | 221 "getdefaultencoding() -> string\n\ |
| 222 \n\ | 222 \n\ |
| 244 | 244 |
| 245 static PyObject * | 245 static PyObject * |
| 246 sys_getfilesystemencoding(PyObject *self) | 246 sys_getfilesystemencoding(PyObject *self) |
| 247 { | 247 { |
| 248 if (Py_FileSystemDefaultEncoding) | 248 if (Py_FileSystemDefaultEncoding) |
| 249 return PyString_FromString(Py_FileSystemDefaultEncoding); | 249 return PyUnicode_FromString(Py_FileSystemDefaultEncoding); |
| 250 Py_INCREF(Py_None); | 250 Py_INCREF(Py_None); |
| 251 return Py_None; | 251 return Py_None; |
| 252 } | 252 } |
| 253 | 253 |
| 254 PyDoc_STRVAR(getfilesystemencoding_doc, | 254 PyDoc_STRVAR(getfilesystemencoding_doc, |
