This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年09月06日 17:53 by brett.cannon, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| stdlib_landmark.diff | twouters, 2011年09月07日 11:25 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg143636 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年09月06日 17:53 | |
Issue11561 had a use case for controlling what module is imported first (along with a patch to use a module other than 'os' to control finding the stdlib). There have been others who could use this feature as well. |
|||
| msg143668 - (view) | Author: Thomas Wouters (twouters) * (Python committer) | Date: 2011年09月07日 11:25 | |
Here's the patch implementing this, which I'd attached to Issue11561 (although I noticed 'hg diff' omitted the empty stdlib_landmark.py file.) |
|||
| msg143770 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年09月09日 17:10 | |
Thomas: I assume you have "hg add"-ed the file; you may need to use git-style diffs to have new files included in diffs: http://hgtip.com/tips/beginner/2009-10-22-always-use-git-diffs/ |
|||
| msg148553 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年11月29日 11:21 | |
I don't think conflating two orthogonal needs in a single "feature" like that is a good idea. This will become one of these obscure implementation details which complicate the code for no real benefit. If there's a need to "customize the first import" then a proper proposal should be made rather than a quick hack. |
|||
| msg148609 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2011年11月29日 20:56 | |
I concur with Antoine. |
|||
| msg181121 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年02月01日 22:07 | |
This would tie into PEP 432 at this point. |
|||
| msg355173 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年10月22日 23:08 | |
I close the issue since I see disagreement on the feature request. Modules/getpath.c and PC/getpathp.c use Lib/os.py to detect the stdlib directory. _PyUnicode_InitEncodings() is the first function importing modules: to import the Python codec of the filesystem encoding. If this import fails, Python now dumps the "path configuration" to help users to debug their setup. See bpo-38236. Example: $ PYTHONHOME=/xxx ./python -c pass Python path configuration: PYTHONHOME = '/xxx' PYTHONPATH = (not set) program name = './python' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '/home/vstinner/python/master/python' sys.base_prefix = '/xxx' sys.base_exec_prefix = '/xxx' sys.executable = '/home/vstinner/python/master/python' sys.prefix = '/xxx' sys.exec_prefix = '/xxx' sys.path = [ '/xxx/lib/python39.zip', '/xxx/lib/python3.9', '/xxx/lib/python3.9/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Current thread 0x00007f845ca19740 (most recent call first): <no Python frame> |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:21 | admin | set | github: 57128 |
| 2019年10月22日 23:08:35 | vstinner | set | status: open -> closed nosy: + vstinner messages: + msg355173 resolution: rejected stage: patch review -> resolved |
| 2013年02月01日 22:07:59 | brett.cannon | set | nosy:
+ ncoghlan messages: + msg181121 |
| 2012年03月12日 17:51:02 | eric.araujo | set | nosy:
+ carljm |
| 2011年11月29日 20:56:10 | rhettinger | set | nosy:
+ rhettinger messages: + msg148609 |
| 2011年11月29日 11:21:46 | pitrou | set | nosy:
+ pitrou messages: + msg148553 |
| 2011年11月29日 06:25:47 | ezio.melotti | set | stage: needs patch -> patch review |
| 2011年09月09日 17:10:50 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg143770 |
| 2011年09月07日 11:25:27 | twouters | set | files:
+ stdlib_landmark.diff nosy: + twouters messages: + msg143668 keywords: + patch |
| 2011年09月06日 19:36:14 | eric.snow | set | nosy:
+ eric.snow |
| 2011年09月06日 17:53:35 | brett.cannon | create | |