Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 64622:999d7d212f17
Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Fri, 10 Sep 2010 21:57:59 +0000 |
| parents | 944232521624 |
| children | 62c58dc912e8 |
comparison
equal
deleted
inserted
replaced
| 64621:252895d49157 | 64622:999d7d212f17 |
|---|---|
| 193 | 193 |
| 194 PyDoc_STRVAR(getfilesystemencoding_doc, | 194 PyDoc_STRVAR(getfilesystemencoding_doc, |
| 195 "getfilesystemencoding() -> string\n\ | 195 "getfilesystemencoding() -> string\n\ |
| 196 \n\ | 196 \n\ |
| 197 Return the encoding used to convert Unicode filenames in\n\ | 197 Return the encoding used to convert Unicode filenames in\n\ |
| 198 operating system filenames." | |
| 199 ); | |
| 200 | |
| 201 static PyObject * | |
| 202 sys_setfilesystemencoding(PyObject *self, PyObject *args) | |
| 203 { | |
| 204 PyObject *new_encoding; | |
| 205 if (!PyArg_ParseTuple(args, "U:setfilesystemencoding", &new_encoding)) | |
| 206 return NULL; | |
| 207 if (_Py_SetFileSystemEncoding(new_encoding)) | |
| 208 return NULL; | |
| 209 Py_INCREF(Py_None); | |
| 210 return Py_None; | |
| 211 } | |
| 212 | |
| 213 PyDoc_STRVAR(setfilesystemencoding_doc, | |
| 214 "setfilesystemencoding(string) -> None\n\ | |
| 215 \n\ | |
| 216 Set the encoding used to convert Unicode filenames in\n\ | |
| 217 operating system filenames." | 198 operating system filenames." |
| 218 ); | 199 ); |
| 219 | 200 |
| 220 static PyObject * | 201 static PyObject * |
| 221 sys_intern(PyObject *self, PyObject *args) | 202 sys_intern(PyObject *self, PyObject *args) |
| 1010 #endif /* MS_WINDOWS */ | 991 #endif /* MS_WINDOWS */ |
| 1011 {"intern", sys_intern, METH_VARARGS, intern_doc}, | 992 {"intern", sys_intern, METH_VARARGS, intern_doc}, |
| 1012 #ifdef USE_MALLOPT | 993 #ifdef USE_MALLOPT |
| 1013 {"mdebug", sys_mdebug, METH_VARARGS}, | 994 {"mdebug", sys_mdebug, METH_VARARGS}, |
| 1014 #endif | 995 #endif |
| 1015 {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS, | |
| 1016 setfilesystemencoding_doc}, | |
| 1017 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, | 996 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, |
| 1018 setcheckinterval_doc}, | 997 setcheckinterval_doc}, |
| 1019 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, | 998 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, |
| 1020 getcheckinterval_doc}, | 999 getcheckinterval_doc}, |
| 1021 #ifdef WITH_THREAD | 1000 #ifdef WITH_THREAD |
