[issue33944] Deprecate and remove pth files

Terry J. Reedy report at bugs.python.org
Thu Jul 5 14:09:27 EDT 2018


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This issue, as stated, looks like a severe regression to me.

In each of my python installs, Lib/site-packages has a file called 'python.pth' containing 'F:/Python'.  This is not a glob of inscrutable code.  It is not even Python code.  Just a path.  Is this issue about something else also called a 'pth file'?

F:/Python latter is a package development directory on my supplementary hard drive.  When I first install a new version of Python (early alpha), I copy this tiny file.  Voila!  The packages within /Python are 'installed' for the new version without making copies.  Editing a file edits it for all 'installs'.  Deleting the directory for an old and no longer needed version does not delete any of my files.

Import in files within F:/Python/pack act as if pack were installed in the site package for the version of python running the file.  I can easily run anything in Command Prompt with 'py -x.y -m pack.file'.  I can easily rerun with a different version by hitting up arrow and changing x.y.  Command Prompt's current working directory does not matter.

I think this is one of Python's most under-appreciated features.  I am rather sure there is no way to so easily get the same effect.  Abuse of a great feature is not a good reason to delete it completely.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33944>
_______________________________________


More information about the Python-bugs-list mailing list