comparison Python/sysmodule.c @ 64349:944232521624

Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are now removed, since their effect was inexistent in 3.x (the default encoding is hardcoded to utf-8 and cannot be changed).
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 01 Sep 2010 18:54:56 +0000
parents 212a16f906a6
children 999d7d212f17
comparison
equal deleted inserted replaced
64346:5a3101f558ed 64349:944232521624
178 PyDoc_STRVAR(getdefaultencoding_doc, 178 PyDoc_STRVAR(getdefaultencoding_doc,
179 "getdefaultencoding() -> string\n\ 179 "getdefaultencoding() -> string\n\
180 \n\ 180 \n\
181 Return the current default string encoding used by the Unicode \n\ 181 Return the current default string encoding used by the Unicode \n\
182 implementation." 182 implementation."
183 );
184
185 static PyObject *
186 sys_setdefaultencoding(PyObject *self, PyObject *args)
187 {
188 char *encoding;
189 if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
190 return NULL;
191 if (PyUnicode_SetDefaultEncoding(encoding))
192 return NULL;
193 Py_INCREF(Py_None);
194 return Py_None;
195 }
196
197 PyDoc_STRVAR(setdefaultencoding_doc,
198 "setdefaultencoding(encoding)\n\
199 \n\
200 Set the current default string encoding used by the Unicode implementation."
201 ); 183 );
202 184
203 static PyObject * 185 static PyObject *
204 sys_getfilesystemencoding(PyObject *self) 186 sys_getfilesystemencoding(PyObject *self)
205 { 187 {
1028 #endif /* MS_WINDOWS */ 1010 #endif /* MS_WINDOWS */
1029 {"intern", sys_intern, METH_VARARGS, intern_doc}, 1011 {"intern", sys_intern, METH_VARARGS, intern_doc},
1030 #ifdef USE_MALLOPT 1012 #ifdef USE_MALLOPT
1031 {"mdebug", sys_mdebug, METH_VARARGS}, 1013 {"mdebug", sys_mdebug, METH_VARARGS},
1032 #endif 1014 #endif
1033 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS,
1034 setdefaultencoding_doc},
1035 {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS, 1015 {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS,
1036 setfilesystemencoding_doc}, 1016 setfilesystemencoding_doc},
1037 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, 1017 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS,
1038 setcheckinterval_doc}, 1018 setcheckinterval_doc},
1039 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, 1019 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS,