Use locale encoding if Py_FileSystemDefaultEncoding is not set

* PyUnicode_EncodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and
   PyUnicode_DecodeFSDefault() use the locale encoding instead of UTF-8 if
   Py_FileSystemDefaultEncoding is NULL
 * redecode_filenames() functions and _Py_code_object_list (issue #9630)
   are no more needed: remove them
This commit is contained in:
Victor Stinner 2010-10-15 12:04:23 +00:00
parent 6a4aff10f0
commit f3170ccef8
8 changed files with 48 additions and 297 deletions

View file

@ -5,8 +5,6 @@
#define NAME_CHARS \
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
PyObject *_Py_code_object_list = NULL;
/* all_name_chars(s): true iff all chars in s are valid NAME_CHARS */
static int
@ -111,17 +109,6 @@ PyCode_New(int argcount, int kwonlyargcount,
co->co_lnotab = lnotab;
co->co_zombieframe = NULL;
co->co_weakreflist = NULL;
if (_Py_code_object_list != NULL) {
int err;
PyObject *ref = PyWeakref_NewRef((PyObject*)co, NULL);
if (ref == NULL)
goto error;
err = PyList_Append(_Py_code_object_list, ref);
Py_DECREF(ref);
if (err)
goto error;
}
}
return co;