This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wrstlprmpft
Recipients
Date 2007-01-29.08:07:40
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This might be intentional, but it is still confusing.

On Windows XP (german)::

  Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
  ...
  In [1]: import os.path as path
  
  In [2]: import os; os.environ['HOME']
  
  Out[2]: 'D:\\HOME'
  
  In [3]: path.realpath('~')
  
  Out[3]: 'C:\\Dokumente und Einstellungen\\wrstl\\~'
  
  In [4]: path.expanduser('~')
  
  Out[4]: 'D:\\HOME'


The cause:
realpath uses path._getfullpathname which seems to do the '~' expansion, while path.expanduser has special code to look for HOME* environment variables.

I would expect that the HOME setting should always be honored if expansion is done.

cheers,
stefan
History
Date User Action Args
2008-01-20 09:59:12adminlinkissue1646838 messages
2008-01-20 09:59:12admincreate