summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
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 /Objects/object.c
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 'Objects/object.c')
-rw-r--r--Objects/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index ff3363f..e322e53 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1604,6 +1604,10 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyCode_Type) < 0)
Py_FatalError("Can't initialize code type");
+ _Py_code_object_list = PyList_New(0);
+ if (_Py_code_object_list == NULL)
+ Py_FatalError("Can't initialize code type");
+
if (PyType_Ready(&PyFrame_Type) < 0)
Py_FatalError("Can't initialize frame type");