summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-15 12:04:23 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-15 12:04:23 (GMT)
commitf3170ccef8809e4a3f82fe9f82dc7a4a486c28c1 (patch)
treeb96ab0a2584f511758bad3e4ccac6c4e3ed43954 /Include
parent6a4aff10f0f1c34f488d5d0f932eea1fb3483dbf (diff)
downloadcpython-f3170ccef8809e4a3f82fe9f82dc7a4a486c28c1.zip
cpython-f3170ccef8809e4a3f82fe9f82dc7a4a486c28c1.tar.gz
cpython-f3170ccef8809e4a3f82fe9f82dc7a4a486c28c1.tar.bz2
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
Diffstat (limited to 'Include')
-rw-r--r--Include/code.h9
-rw-r--r--Include/unicodeobject.h9
2 files changed, 7 insertions, 11 deletions
diff --git a/Include/code.h b/Include/code.h
index bdbfaba..11ecc95 100644
--- a/Include/code.h
+++ b/Include/code.h
@@ -72,7 +72,7 @@ PyAPI_DATA(PyTypeObject) PyCode_Type;
PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
- PyObject *, PyObject *, int, PyObject *);
+ PyObject *, PyObject *, int, PyObject *);
/* same as struct above */
/* Creates a new empty code object with the specified source location. */
@@ -99,13 +99,6 @@ PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
PyObject *names, PyObject *lineno_obj);
-/* List of weak references to all code objects. The list is used by
- initfsencoding() to redecode code filenames at startup if the filesystem
- encoding changes. At initfsencoding() exit, the list is set to NULL and it
- is no more used. */
-
-extern PyObject *_Py_code_object_list;
-
#ifdef __cplusplus
}
#endif
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 39a6b2e..f61712b 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1193,7 +1193,8 @@ PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
/* Decode a null-terminated string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
- If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
*/
@@ -1205,7 +1206,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
/* Decode a string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
- If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
@@ -1216,7 +1218,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
/* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
"surrogateescape" error handler, and return bytes.
- If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
+ If Py_FileSystemDefaultEncoding is not set, fall back to the locale
+ encoding.
*/
PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(