[Python-ideas] Security: remove "." from sys.path?

Chris Barker chris.barker at noaa.gov
Mon Jun 5 13:51:18 EDT 2017


On Mon, Jun 5, 2017 at 3:55 AM, Victor Stinner <victor.stinner at gmail.com>
wrote:

> A minimum change would be to add the (empty string) at the end of sys.path
> in Python 3.7 rather than adding it at the start.
>
> It would increase Python usability since it avoids the "random has no
> randint() function" caused by a random.py file in the script directory. In
> my experience, this bug hits every developers starting to learn Python and
> it can be very strange when you get the error when trying to run IDLE.
>

But it would add the "why won't python import my file?!??!" problem, which
newbies also struggle with.

Which leaves me with no suggestion for a solution...

-CHB



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170605/e896fe03/attachment.html>


More information about the Python-ideas mailing list