neonene <nicesal...@gmail.com> added the comment:

After this contribution, when using module at the root dir (maybe bad manners), 
the followings are expected behaviors?

(1) relative drive in sys.path -> bytecode is not put in __pycache__ folder.

>>> import sys
>>> sys.path.append('F:')  # flash device, etc...
>>> import foo
>>> foo.__file__
'F:foo.py'
>>> foo.__cached__
'F:foo.cpython-311.pyc'


(2) absolute drive in sys.path -> __pycache__ is under current dir, not 
absolute.

>>> import sys
>>> sys.path.append('F:\\')
>>> import foo
>>> foo.__file__
'F:\\foo.py'
>>> foo.__cached__
'F:__pycache__\\foo.cpython-311.pyc'

----------
nosy: +neonene

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

Reply via email to