summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 16:35:47 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 16:35:47 (GMT)
commitc39211f51e377919952b139c46e295800cbc2a8d (patch)
treeefdb794b06981b5047e699d606b2876e2170b07e /Include
parenta5785b1524074656f0a0ec64e5e5cdb27aa3a356 (diff)
downloadcpython-c39211f51e377919952b139c46e295800cbc2a8d.zip
cpython-c39211f51e377919952b139c46e295800cbc2a8d.tar.gz
cpython-c39211f51e377919952b139c46e295800cbc2a8d.tar.bz2
Issue #9630: Redecode filenames when setting the filesystem encoding
Redecode the filenames of: - all modules: __file__ and __path__ attributes - all code objects: co_filename attribute - sys.path - sys.meta_path - sys.executable - sys.path_importer_cache (keys) Keep weak references to all code objects until initfsencoding() is called, to be able to redecode co_filename attribute of all code objects.
Diffstat (limited to 'Include')
-rw-r--r--Include/code.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/code.h b/Include/code.h
index f0f88cd..bdbfaba 100644
--- a/Include/code.h
+++ b/Include/code.h
@@ -99,6 +99,13 @@ 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