[PATCH RFC-STABLE] warn about harmful PYTHONPATH values (issue2557)

Matt Mackall mpm at selenic.com
Fri May 4 11:33:50 CDT 2012


On Fri, 2012-05-04 at 14:25 +0200, pierre-yves.david at logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1336134161 -7200
> # Branch stable
> # Node ID 62db511c03ef5af6a421512e788a642bdacf5d24
> # Parent  9450905de257e1ed09e1855ede0305567cf07b51
> warn about harmful PYTHONPATH values (issue2557)
> 
> The following values will add $PWD to `sys.path`::
> 
>   PYTHONPATH='/foo/bar/:/jungle/babar:'
>   PYTHONPATH=':/foo/bar/:/jungle/babar'
>   PYTHONPATH='/foo/bar/::/jungle/babar'
>   PYTHONPATH=''
> 
> This changeset add a warning at mercurial startup about the issue::
> 
>   WARNING: your PYTHONPATH end with ":"!
>   WARNING: Python will add the current directory to import path.
>   WARNING: Fix your PYTHONPATH to avoid potential erroneous import.

Not excited about this. It's not really our job to make sure people
don't do stupid things with their Python setup.

Now that we add our own library path to the installed executable, we
should probably instead be deleting any reference to PYTHONPATH from our
docs so people aren't tempted to mess with it.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list