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

Martin Geisler mg at aragost.com
Fri May 4 09:21:32 CDT 2012


pierre-yves.david at logilab.fr writes:

> # 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.

Printing three lines like that will make it unbearable to use Mercurial
with that PYTHONPATH. That's of course kind of the goal of the patch, so
maybe it would be better to abort instead?

-- 
Martin Geisler

aragost Trifork
Commercial Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list