diff 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
line wrap: on
line diff
--- a/Python/sysmodule.c	Wed Sep 01 15:10:12 2010 +0000
+++ b/Python/sysmodule.c	Wed Sep 01 18:54:56 2010 +0000
@@ -183,24 +183,6 @@
 );
 
 static PyObject *
-sys_setdefaultencoding(PyObject *self, PyObject *args)
-{
-    char *encoding;
-    if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
-        return NULL;
-    if (PyUnicode_SetDefaultEncoding(encoding))
-        return NULL;
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-PyDoc_STRVAR(setdefaultencoding_doc,
-"setdefaultencoding(encoding)\n\
-\n\
-Set the current default string encoding used by the Unicode implementation."
-);
-
-static PyObject *
 sys_getfilesystemencoding(PyObject *self)
 {
     if (Py_FileSystemDefaultEncoding)
@@ -1030,8 +1012,6 @@
 #ifdef USE_MALLOPT
     {"mdebug",          sys_mdebug, METH_VARARGS},
 #endif
-    {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS,
-     setdefaultencoding_doc},
     {"setfilesystemencoding", sys_setfilesystemencoding, METH_VARARGS,
      setfilesystemencoding_doc},
     {"setcheckinterval",        sys_setcheckinterval, METH_VARARGS,