[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-13 Thread Armin Rigo

Armin Rigo added the comment:

Grrr, ok, I have an "alias ls='/bin/ls'".  It seems that both "PATH=" and 
"unset PATH" are equivalent to "PATH=.".  This is behavior that we cannot add 
to PYTHONPATH, I fear, because so far "." is not implicitly included if 
PYTHONPATH is not set.  Or if we do it's a big change, not just an internal 
fix...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread R. David Murray

R. David Murray added the comment:

I don't think bin is included:

  > PATH= gzip
  bash: gzip: No such file or directory

But you are right...unset seems to be equivalent to PATH=
I could have sworn it acted different when I tried it, but I just ran it again 
and it it acted the same, which makes sense.

So given that I agree that the fix is good.  And further fixing is not :).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread Armin Rigo

Armin Rigo added the comment:

Uh, confusion.  Indeed, "PATH= foo" finds foo in the current directory on bash. 
 I'm not sure how I ran the original example.  It seems that a default PATH is 
used, which includes at least "/bin" and ".".

The point I was making in the original post is still valid: "PATH= foo" appears 
to behave identically to "unset PATH && foo" in all cases I tried so far.  For 
example, for me both work with some local executable or with "ls" (which is in 
/bin), and neither works with "which" (which is in /usr/bin).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread Tom Vaughan

Tom Vaughan added the comment:

Oh wow. That is not what I remembered/assumed about sh and PATH. Mind. Blown.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread R. David Murray

R. David Murray added the comment:

Hmm.  Although that argues that the original behavior was in fact correct.  At 
least, the behavior of bash and zsh for me is that

   PATH= foo

finds foo if it is in the local directory, contradicting the claim made in the 
original post.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread Tom Vaughan

Tom Vaughan added the comment:

PATHONPATH=/tmp: will also be interpreted as "/tmp" and ".". Do the patches 
also address this case? PYTHONPATH=:/tmp and PYTHONPATH=/foo::/bar are also 
problematic.

--
nosy: +tvaughan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2013-04-12 Thread R. David Murray

R. David Murray added the comment:

It may be problematic, but it is also consistent with the way the shell works 
in general.  (Try the same things with PATH.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-11-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 803e5a732331 by Ezio Melotti in branch 'default':
#16309: avoid using deprecated method and turn docstring in a comment.
http://hg.python.org/cpython/rev/803e5a732331

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-11-03 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks.

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-11-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 05f8f7544f92 by Andrew Svetlov in branch 'default':
Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at 
all.
http://hg.python.org/cpython/rev/05f8f7544f92

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-11-03 Thread Alexey Kachayev

Alexey Kachayev added the comment:

Unit test added. pythonpath2.diff is included into issue16309.diff.

--
nosy: +kachayev
Added file: http://bugs.python.org/file27848/issue16309.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-28 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I would to see some unittest if possible.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-28 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-26 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-25 Thread Eric Snow

Eric Snow added the comment:

> Given how confusing it seems, perhaps we should change it to
> adopt a PATH-like behaviour.

Wouldn't that introduce a backward-compatibility issue?  FWIW, otherwise I 
agree that it makes a lot of sense to conform to the same behavior as PATH.

--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-25 Thread Armin Rigo

Armin Rigo added the comment:

Attached another simpler diff (only one "+" line instead of two...).

--
Added file: http://bugs.python.org/file27712/pythonpath2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-25 Thread Armin Rigo

Armin Rigo added the comment:

Attached the diff, in case we want to do that.  The diff is only about 
non-Windows platforms, given that it follows a Posix use case about PATH.  But 
do we also need to change PC/getpathp.c?

--
keywords: +patch
Added file: http://bugs.python.org/file27709/pythonpath.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-24 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Given how confusing it seems, perhaps we should change it to adopt a PATH-like 
behaviour.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16309] "PYTHONPATH=" different from no PYTHONPATH at all

2012-10-24 Thread Armin Rigo

New submission from Armin Rigo:

On Posix, it is documented that setting PATH to the empty string is equivalent 
to not setting PATH at all, which is an exception to the rule that in a string 
like "/bin::/usr/bin" the empty string in the middle gets interpreted as ".".

PYTHONPATH does not have this exception: an empty PYTHONPATH is interpreted as 
equivalent to ".".

This difference is not documented.  This is a detail, but a possible source of 
confusion, so I'm reporting it here.

How to reproduce:

file x/x.py: "import z"
file z.py: "print(42)"

The following two lines behave differently (Bash syntax):

PYTHONPATH= python x/x.py
unset PYTHONPATH && python x/x.py

For comparison, if "./foo" is an executable, the following two lines behave 
identically (neither finds "./foo"):

PATH= foo
unset PATH && foo

--
components: Interpreter Core
keywords: easy
messages: 173665
nosy: arigo
priority: normal
severity: normal
status: open
title: "PYTHONPATH=" different from no PYTHONPATH at all
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com