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 yan12125
Recipients brett.cannon, chris.jerdonek, jayyin11043, yan12125
Date 2018-02-09.16:11:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518192671.61.0.467229070634.issue32642@psf.upfronthosting.co.za>
In-reply-to
Content
> what file(s) is/are the sys.path code located in?

If I understand it correctly, sys.path is handled in importlib._bootstrap_external.PathFinder.find_spec(). I can patch PathFinder for handling path-like objects: https://github.com/yan12125/cpython/commit/e3fd473b54cbb368533e651fd896bbc813a43924

Here's an example usage:

# t.py
import pathlib
import sys

sys.path.append(pathlib.Path('foo'))

import s

# foo/s.py
print(123)
History
Date User Action Args
2018-02-09 16:11:11yan12125setrecipients: + yan12125, brett.cannon, chris.jerdonek, jayyin11043
2018-02-09 16:11:11yan12125setmessageid: <1518192671.61.0.467229070634.issue32642@psf.upfronthosting.co.za>
2018-02-09 16:11:11yan12125linkissue32642 messages
2018-02-09 16:11:11yan12125create