Nir Soffer wrote: > However, I found this alarming note in the docs: > > normpath(path) > ... > "It should be understood that this may change the meaning of the path > if it contains symbolic links!" > > The function docstring does not contain this note: > > """Normalize path, eliminating double slashes, etc.""" > > And finally, there is no test for this symbolic link problem. > > Anyone has a clue about this?
if BAR is a symbolic link, FOO/BAR/../DIR isn't necessarily the same thing as FOO/DIR. a simple example: $ ln -s /etc etc $ ls -ld etc lrwxrwxrwx 1 fredrik fredrik 4 Dec 2 23:22 etc -> /etc $ etc/../usr/local/bin/python2.4 Python 2.4.1 (#1, Sep 12 2005, 19:35:02) ... >>> import os >>> os.path.normpath("etc/../usr/local/bin/python2.4") 'usr/local/bin/python2.4' >>> <control-D> $ usr/local/bin/python2.4 -bash: usr/local/bin/python2.4: No such file or directory </F> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com