Mercurial > cpython-lru_cache-weakref
diff Include/code.h @ 65021:01b96f78fb70
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.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Wed, 29 Sep 2010 16:35:47 +0000 |
| parents | eea72b81a23c |
| children | 453fd8182c2f |
line wrap: on
line diff
--- a/Include/code.h Wed Sep 29 16:19:50 2010 +0000 +++ b/Include/code.h Wed Sep 29 16:35:47 2010 +0000 @@ -99,6 +99,13 @@ 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
