Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IDLE not setting current directory in its path

18 views
Skip to first unread message

gujax

unread,
Jan 30, 2012, 10:06:54 AM1/30/12
to
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

Terry Reedy

unread,
Jan 30, 2012, 3:15:35 PM1/30/12
to pytho...@python.org
On 1/30/2012 10:06 AM, gujax wrote:
> Hi,
> When I open python shell and change to any directory, the sys.path
> always shows ' '.

It actually shows '' (without a space).

> 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..].

This issue is under consideration at
http://bugs.python.org/issue13506
I will be looking at the patch soon.

--
Terry Jan Reedy

Terry Reedy

unread,
Jan 30, 2012, 10:55:35 PM1/30/12
to pytho...@python.org
On 1/30/2012 3:15 PM, Terry Reedy wrote:

> This issue is under consideration at
> http://bugs.python.org/issue13506

It should be fixed before the next Python releases.

--
Terry Jan Reedy

gujax

unread,
Jan 31, 2012, 11:27:15 AM1/31/12
to
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

Terry Reedy

unread,
Jan 31, 2012, 6:12:56 PM1/31/12
to pytho...@python.org
On 1/31/2012 11:27 AM, gujax wrote:
> 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.

--
Terry Jan Reedy

gujax

unread,
Feb 3, 2012, 10:31:03 AM2/3/12
to
On Jan 31, 6:12 pm, Terry Reedy <tjre...@udel.edu> wrote:
> On 1/31/2012 11:27 AM, gujax wrote:
>
> > 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
>
Thank you Terry,
The patch suggested by you has worked for me,
gujax

gujax

unread,
Feb 3, 2012, 10:23:36 AM2/3/12
to
On Jan 31, 6:12 pm, Terry Reedy <tjre...@udel.edu> wrote:
> On 1/31/2012 11:27 AM,gujaxwrote:
>
> > 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
>
Hi Terry,
I changed the two files as suggested in your patch and it worked.
Thank you,
gujax
0 new messages