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.

Author vstinner
Recipients brett.cannon, carljm, eric.araujo, eric.snow, ncoghlan, pitrou, rhettinger, twouters, vstinner
Date 2019-10-22.23:08:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571785715.1.0.188181066265.issue12919@roundup.psfhosted.org>
In-reply-to
Content
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
2019-10-22 23:08:35vstinnersetrecipients: + vstinner, twouters, brett.cannon, rhettinger, ncoghlan, pitrou, carljm, eric.araujo, eric.snow
2019-10-22 23:08:35vstinnersetmessageid: <1571785715.1.0.188181066265.issue12919@roundup.psfhosted.org>
2019-10-22 23:08:35vstinnerlinkissue12919 messages
2019-10-22 23:08:34vstinnercreate