Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 49403:e822992cf6ce
Issue #3187: Add sys.setfilesystemencoding.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Fri, 03 Oct 2008 16:09:28 +0000 |
| parents | de0bf60f1245 |
| children | cbc3afc1e40a |
comparison
equal
deleted
inserted
replaced
| 49394:4f772004a85d | 49403:e822992cf6ce |
|---|---|
| 214 \n\ | 214 \n\ |
| 215 Return the encoding used to convert Unicode filenames in\n\ | 215 Return the encoding used to convert Unicode filenames in\n\ |
| 216 operating system filenames." | 216 operating system filenames." |
| 217 ); | 217 ); |
| 218 | 218 |
| 219 | 219 static PyObject * |
| 220 sys_setfilesystemencoding(PyObject *self, PyObject *args) | |
| 221 { | |
| 222 PyObject *new_encoding; | |
| 223 if (!PyArg_ParseTuple(args, "U:setfilesystemencoding", &new_encoding)) | |
| 224 return NULL; | |
| 225 if (_Py_SetFileSystemEncoding(new_encoding)) | |
| 226 return NULL; | |
| 227 Py_INCREF(Py_None); | |
| 228 return Py_None; | |
| 229 } | |
| 230 | |
| 231 PyDoc_STRVAR(setfilesystemencoding_doc, | |
| 232 "setfilesystemencoding(string) -> None\n\ | |
| 233 \n\ | |
| 234 Set the encoding used to convert Unicode filenames in\n\ | |
| 235 operating system filenames." | |
| 236 ); | |
| 220 | 237 |
| 221 static PyObject * | 238 static PyObject * |
| 222 sys_intern(PyObject *self, PyObject *args) | 239 sys_intern(PyObject *self, PyObject *args) |
| 223 { | 240 { |
| 224 PyObject *s; | 241 PyObject *s; |
| 870 #ifdef USE_MALLOPT | 887 #ifdef USE_MALLOPT |
| 871 {"mdebug", sys_mdebug, METH_VARARGS}, | 888 {"mdebug", sys_mdebug, METH_VARARGS}, |
| 872 #endif | 889 #endif |
| 873 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, | 890 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, |
| 874 setdefaultencoding_doc}, | 891 setdefaultencoding_doc}, |
| 892 {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS, | |
| 893 setfilesystemencoding_doc}, | |
| 875 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, | 894 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, |
| 876 setcheckinterval_doc}, | 895 setcheckinterval_doc}, |
| 877 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, | 896 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, |
| 878 getcheckinterval_doc}, | 897 getcheckinterval_doc}, |
| 879 #ifdef HAVE_DLOPEN | 898 #ifdef HAVE_DLOPEN |
