Re: problem with Distributed File System Replication and Namespacing and different versions of Python 3

Steve Dower <[email protected]> Mon, 24 Oct 2022 20:54:20 +0100
Newsgroups gmane.comp.python.devel
Message-ID <[email protected]>
On 10/20/2022 1:07 PM, [email protected] wrote:
> What happens is, when injecting into the sys.path the domain names it doesnt import but when injecting into the sys.path the "real" file server path it works, generally speaking. We have been facing this issue in such different python 3 versions and i was wondering what makes this work in Python 3.10.2.

We added some path fixes into importlib in 3.10 that will result in 
better path resolution during import on Windows, particularly when 
resolving partial paths. You'll find them in 
Lib/importlib/_bootstrap_external.py and Modules/posixmodule.c (they're 
not real obvious - you'll be best to diff those files).

You're unlikely to easily backport them to earlier versions, so your 
current workaround is probably best. If the problems are due to 
*writing* bytecode files, you might also be able to use 
PYTHONPYCACHEPREFIX to reference a local directory and avoid issues that 
way.

Cheers,
Steve