[New-bugs-announce] [issue11397] os.path.realpath() may produce incorrect results

Mikhail Kovtun report at bugs.python.org
Fri Mar 4 18:17:18 CET 2011


New submission from Mikhail Kovtun <mikhail.kovtun at duke.edu>:

This bug appears in Python 2.4, 2.5, 2.6; not tested in Python 2.7.

How to reproduce on Linux:
{{{
$ mkdir ~/testsymlinks
$ cd ~/testsymlinks
$ mkdir adir
$ ln -s ../adir adir/blink
$ mkdir -p  adir/cdir/ddir
$ ln -s adir/cdir/ddir/.. xlink
$ ln -s xlink/../blink zlink
}}}
Then:
{{{
$ readlink zlink -f
/home/user/testsymlinks/adir
}}}
but:
{{{
$ python
Python 2.4.3 (#1, Sep  3 2009, 15:37:37) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.realpath('zlink')
'/home/user/testsymlinks/blink'
>>>
}}}

----------
components: Extension Modules
messages: 130060
nosy: mkovtun
priority: normal
severity: normal
status: open
title: os.path.realpath() may produce incorrect results
type: behavior
versions: Python 2.5, Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11397>
_______________________________________


More information about the New-bugs-announce mailing list