Chih-Hsuan Yen <yan12...@gmail.com> added the comment:

> 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)

----------
nosy: +yan12125

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32642>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to