[ python-Bugs-1433667 ] os.path.expandvars sometimes doesn't expand $HOSTNAME

SourceForge.net noreply at sourceforge.net
Fri Feb 17 20:20:08 CET 2006


Bugs item #1433667, was opened at 2006-02-17 12:03
Message generated for change (Comment added) made by neurogeek
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1433667&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Doug Fort (dougfort)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.path.expandvars sometimes doesn't expand $HOSTNAME

Initial Comment:

$ echo "$HOSTNAME"
c0a80165.tipt.aol.com
$ /usr/local/bin/python
Python 2.4.2 (#1, Dec 30 2005, 11:14:42) 
[GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os.path
>>> os.path.expandvars("$HOME")
'/Users/dougfort'
>>> os.path.expandvars("$HOSTNAME")
'$HOSTNAME'
>>> 

arthurformat-d09:arthur$ echo $HOSTNAME
arthurformat-d09.ats.aol.com
arthurformat-d09:arthur$ /cm/tools/bin/python
Python 2.3.4 (#1, Jul 28 2004, 14:55:53) 
[GCC 3.3.1] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os.path
>>> os.path.expandvars("$HOME")
'/opt/aol/production/arthur'
>>> os.path.expandvars("$HOSTNAME")
'arthurformat-d09.ats.aol.com'


----------------------------------------------------------------------

Comment By: neurogeek (neurogeek)
Date: 2006-02-17 15:20

Message:
Logged In: YES 
user_id=1394223

No problem for me in a Gentoo box in python 2.3.4 nor python
2.4.2

Is the problem persistent? could you give some meore info on
this?

----------------------------------------------------------------------

Comment By: Georg Brandl (birkenfeld)
Date: 2006-02-17 14:13

Message:
Logged In: YES 
user_id=1188172

It might be good if you explain what the differences between
the two snippets are, environment-wise.

The first question that comes to mind is: is $HOSTNAME
exported in the first shell?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1433667&group_id=5470


More information about the Python-bugs-list mailing list