[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread Eryk Sun
Eryk Sun added the comment: > Run "python3 -I script.py" to not insert '' (current directory) > at the first position of sys.path. That should be "script directory", not "current directory". We only add the current directory to sys.path in interactive mode, and for -c and -m. Adding the curre

[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread STINNER Victor
STINNER Victor added the comment: Run "python3 -I script.py" to not insert '' (current directory) at the first position of sys.path. https://docs.python.org/dev/using/cmdline.html#cmdoption-I -- nosy: +haypo ___ Python tracker

[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread Ammar Askar
Ammar Askar added the comment: As per discussion with haypo on irc, this is not a bug since essentially you've made a file which shadows the following stdlib module https://docs.python.org/3/library/copy.html When shutil goes to import the copy module, your copy module is given higher priorit

[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread Ammar Askar
Ammar Askar added the comment: I was only able to recreate this under 3.4 and 3.3, and both of them are under "security" status on https://docs.python.org/devguide/#status-of-python-branches Should this be marked as won't fix? -- nosy: +ammar2 versions: +Python 3.3, Python 3.4 -Python

[issue29821] importing module shutil executes file 'copy.py'

2017-03-15 Thread Oliver Etchebarne (drmad)
New submission from Oliver Etchebarne (drmad): I didn't research this issue further. Create a file 'test.py', and write only 'import shutil'. Then create a file 'copy.py' in the same directory, and write something inside, like 'print ("OH NO")'. When you run test.py, 'copy.py' is executed, and