Title: Add _pth breadcrumb to sys.path documentation
Type: enhancement Stage: needs patch
Components: Documentation, Windows Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Traveler Hauptman, docs@python, eric.snow, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2017-09-26 04:47 by Traveler Hauptman, last changed 2017-09-29 21:19 by steve.dower.

Messages (2)
msg303000 - (view) Author: Traveler Hauptman (Traveler Hauptman) Date: 2017-09-26 04:47
Python on windows (winpython) was not adding PYTHONPATH to sys.path as documented and I could not understand why.

It took a lot of time, web searches, and finally a tour through the code to find out about _pth; which is well documented but difficult to find out about if you don't know about it beforehand.

Please improve the sys.path documentation to say that it depends on either PYTHONPATH or the *._pth file. Better yet, link to the actual sys.path heuristics.
msg303358 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-09-29 21:19
Sounds like a good idea.

I hope that sys.path initialization is documented as well for POSIX as it is for Windows, as that will make this a simple "for X, click here; for Y, click here" patch. Otherwise, someone will need to figure out exactly what rules are followed so they can be documented.

(Hey Eric - when we get that Python initialization script, we can have one set of rules for inferring sys.path on all platforms in easy-to-read Python code :) )
Date User Action Args
2017-09-29 21:19:25steve.dowersetversions: + Python 3.6, Python 3.7
nosy: + eric.snow

messages: + msg303358

stage: needs patch
2017-09-29 16:22:01eric.araujosetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows
2017-09-26 04:47:20Traveler Hauptmancreate