[Python-ideas] [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Nov 2 19:02:56 EST 2015


Terry Reedy wrote:
> '' is not very informative ;-).
> I suspect the full path added in the past, but it is not now.
> import os; os.getcwd() works better

You misunderstand. The point is *not* to find the
cwd, it's to find the directory containing the main
script, so you can load resources related to it.

There are probably other and possibly better ways
to go about that, but it works and is sometimes
used. The proposed change would break it.

-- 
Greg


More information about the Python-ideas mailing list