Bug#321973: python2.3: PYTHONPATH doesn't expand ~

2005-08-15 Thread Henrik Holmboe

Matthias Klose <[EMAIL PROTECTED]> writes:

>Henrik Holmboe writes:
>> PYTHONPATH should behave like PATH according to section 6.1.1 (see URL
>> below) of the Python Tutorial. But I have found that it doesnt
>> properly expand ~ (tilde) to the home directory.
>> 
>> A workaround is to use ${HOME} instead of ~, but both should work as
>> advertised.
>> 
>> 
>
>no, you' never see ~ in PATH as well. It's expanded by the shell. Same
>with PYTHONPATH, which gets exanded by the shell, not python.

Incorrect.

I set both $PATH and $PYTHONPATH in .bashrc, and after some testing it
seems that bash doesnt expand tilde at the time of reading .bashrc if
its enclosed in quotes (which I currently do), but it is expanded on
the fly (works with tab-completion etc). So the conclusion is that
Python doesnt expand tilde in $PYTHONPATH, but relies on that the
variable is already expanded by the shell. Hence that $PYTHONPATH
doesnt behave like $PATH.

1)
   $ grep PATH .bashrc
   export 
PATH="~/profile/bin:/usr/local/bin:/usr/bin:/usr/games:/usr/bin/X11:/bin"

   $ echo $PATH
   ~/profile/bin:/usr/local/bin:/usr/bin:/usr/games:/usr/bin/X11:/bin

2)
   $ grep PATH .bashrc
   export 
PATH=~/profile/bin:/usr/local/bin:/usr/bin:/usr/games:/usr/bin/X11:/bin
   $ echo $PATH
   /home/hh/profile/bin:/usr/local/bin:/usr/bin:/usr/games:/usr/bin/X11:/bin

Both $PYTHONPATH and $PATH can use $HOME when exporting, since that is
always expanded, with or without quotes.

-- 
Henrik Holmboe, Stockholm, Sweden



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#321973: python2.3: PYTHONPATH doesn't expand ~

2005-08-08 Thread Henrik Holmboe
Package: python2.3
Version: 2.3.5-3
Severity: minor

*** Please type your report below this line *** According to section
PYTHONPATH should behave like PATH according to section 6.1.1 (see URL
below) of the Python Tutorial. But I have found that it doesnt
properly expand ~ (tilde) to the home directory.

A workaround is to use ${HOME} instead of ~, but both should work as
advertised.



-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (400, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-1-686-smp
Locale: LANG=C, LC_CTYPE=sv_SE.ISO-8859-1 (charmap=ISO-8859-1)

Versions of packages python2.3 depends on:
ii  libbz2-1.0 1.0.2-7   high-quality block-sorting file co
ii  libc6  2.3.2.ds1-22  GNU C Library: Shared libraries an
ii  libdb4.2   4.2.52-18 Berkeley v4.2 Database Libraries [
ii  libncurses55.4-9 Shared libraries for terminal hand
ii  libreadline4   4.3-11GNU readline and history libraries
ii  libssl0.9.70.9.7e-3  SSL shared libraries
ii  zlib1g 1:1.2.2-4.sarge.2 compression library - runtime

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]