Hello,

Does site.py provide a reliable means to reinitialize sys.path of a
running process?

I see that Python 2.7 added site.getsitepackages() which gives the
paths needed to reinitialize explicitly, but it appears that
virtualenv's site.py does not include this change.
https://github.com/pypa/virtualenv/blob/5b904f88583d40954701c5471527fc07c7ae9056/virtualenv_embedded/site.py

To give some context, I'm interested in code reloading inside
virtualenvs on production systems where I would like to reduce
downtime to 0. Packages installed as non-zip eggs are added to a .pth
file, and attempts to reload(module) or even __import__ in a child
process do not get the new code since sys.path is still pointing at
the old paths given at the time the .pth file was read.

Thanks,

Ron
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to