summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-09-10 21:57:59 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-09-10 21:57:59 (GMT)
commit5b519e02016ea3a51f784dee70eead3be4ab1aff (patch)
tree5886b329aef1b3d5fe965c78b97f82f99b93f6bf /Python/bltinmodule.c
parent6246d6dcb01c690fd82e870e5c4affbd2848d22c (diff)
downloadcpython-5b519e02016ea3a51f784dee70eead3be4ab1aff.zip
cpython-5b519e02016ea3a51f784dee70eead3be4ab1aff.tar.gz
cpython-5b519e02016ea3a51f784dee70eead3be4ab1aff.tar.bz2
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.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3bcb08e..60bceb7 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -33,29 +33,6 @@ const char *Py_FileSystemDefaultEncoding = "utf-8";
int Py_HasFileSystemDefaultEncoding = 1;
#endif
-int
-_Py_SetFileSystemEncoding(PyObject *s)
-{
- PyObject *defenc, *codec;
- if (!PyUnicode_Check(s)) {
- PyErr_BadInternalCall();
- return -1;
- }
- defenc = _PyUnicode_AsDefaultEncodedString(s, NULL);
- if (!defenc)
- return -1;
- codec = _PyCodec_Lookup(PyBytes_AsString(defenc));
- if (codec == NULL)
- return -1;
- Py_DECREF(codec);
- if (!Py_HasFileSystemDefaultEncoding && Py_FileSystemDefaultEncoding)
- /* A file system encoding was set at run-time */
- free((char*)Py_FileSystemDefaultEncoding);
- Py_FileSystemDefaultEncoding = strdup(PyBytes_AsString(defenc));
- Py_HasFileSystemDefaultEncoding = 0;
- return 0;
-}
-
static PyObject *
builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
{