Steve Dower <steve.do...@python.org> added the comment:

I took a look at the docs PR, and honestly I don't even get what the "intended" 
uses of executable code are supposed to be.

The examples are "load 3rd-party import hooks, adjust PATH variable", but the 
only cases I can think of where you'd need to do these in a .pth file is where 
your module is a single file. As soon as you have a package with __init__.py, 
you have a file that can do exactly the same modifications before the module 
that needs it is imported.

I'd be inclined to limit the doc change to not provide any "valid" uses for 
this, and just discourage doing anything that takes a long time (most of the 
text in the PR is fine, IMHO).

And yeah, I'd like to see the arbitrary code execution "feature" removed too.

As for .pth files in general, I'm interested in the scenarios that caused Barry 
to have to do difficult debugging where "python -m site" wasn't able to help. 
If they all involved arbitrary code execution, then let's take out the right 
tumor. But if they somehow manipulated sys.path in a way that looking at 
sys.path doesn't reveal, then I'd like to know how.

----------

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

Reply via email to