[issue33944] Deprecate and remove pth files

Barry A. Warsaw report at bugs.python.org
Tue Feb 26 18:31:47 EST 2019


Barry A. Warsaw <barry at python.org> added the comment:

On Feb 26, 2019, at 12:52, Ionel Cristian Mărieș <report at bugs.python.org> wrote:
> 
> Something bad was installed with sudo but suddenly sudo is not acceptable for debugging? This seems crazy.

Your sudo may not be my sudo. :)  Let’s say I update my Ubuntu desktop and a new version of package with a pth breaks.  Maybe I didn’t even know I was doing that, via automated updates, or management portal, etc.  Now a poor user who depends on this has their code break.  How do *they* debug the problem?

FWIW, `sudo pip install` should just be banned IMHO :).

> How exactly are pth files hard to debug? Are those files hard to edit? They sure are, but the problem ain't the point where they are run, it's the fact that a big lump of code is stuffed on a single line. Lets fix that instead!

For sure.  But here’s the thing: you need to know *which* pth file is problematic.  Which means you have to debug the entire startup process where pth files are loaded.  That means you’re not really debugging pth files themselves (often), but site.py.  Debugging site.py for an installed Python is not trivial.  Hopefully you are at least not squeamish about editing a system file and breaking Python worse than the original bug. <wink>

----------

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


More information about the Python-bugs-list mailing list