A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-December/058453.html below:

[Python-Dev] os.normpath may change the meaning of the path if itcontains symbolic links?

[Python-Dev] os.normpath may change the meaning of the path if itcontains symbolic links? [Python-Dev] os.normpath may change the meaning of the path if itcontains symbolic links?Fredrik Lundh fredrik at pythonware.com
Fri Dec 2 23:34:34 CET 2005
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> 



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4