IDLE not setting current directory in its path

G

gujax

Hi,
When I open python shell and change to any directory, the sys.path
always shows ' '. This means it has temporarily added the current
directory to its path i.e., sys.path shows [' ', other paths....]

I can then load any module from the current directory even though the
current directory is not listed in the PYTHONPATH..

When I do the same with IDLE, it shows the name of the current
directory i.e., ['name1', other paths...] instead of showing [' ',
other paths..].

Therefore, when I change the directory to some other directory say
'name2' and type sys.path, I get the same name as the original
directory which I started with (i.e., name1, while name2 is not added
to the path automatically as done by ' ').

Therefore, I am unable to load any modules from this current changed
directory.

In short how to configure IDLE to automatically add current directory
to its path without typing every time
sys.path.append..
Any help is appreciated.
Thanks
 
G

gujax

Thanks Terry,
I see that the issue has been closed by you.
However, I do not know how to run the patch on my Windows. Do I
reinstall IDLE?
Please suggest. I am using Python2.7
gujax
 
T

Terry Reedy

Thanks Terry,
I see that the issue has been closed by you.
However, I do not know how to run the patch on my Windows. Do I
reinstall IDLE?
Please suggest. I am using Python2.7

Choices:
1. Wait for the next 2.7 release, which should be within a month.
Easiest ;-). Will get you all other patches too.
2. Edit the files by hand, deleting lines marked - in the patch and
adding lines marked +. Or change lines so they match the + lines.
Harder, but you get the one change now instead of later.
3. Download and install TortoiseHG, turn your python installation (or
just the idlelib directory) into a repository, apply the patch (or an
edited version thereof), and perhaps delete the repository stuff. I
would only do this if you want to learn to use (Tortoise)HG anyway,
perhaps so you can apply other patches too, without waiting.
 
G

gujax

Hi Terry,
I changed the two files as suggested in your patch and it worked.
Thank you,
gujax
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top