2008/10/18 TK Soh <[EMAIL PROTECTED]>

> On Fri, Oct 17, 2008 at 8:32 PM,  <[EMAIL PROTECTED]> wrote:
> > # HG changeset patch
> > # User Peer Sommerlund <[EMAIL PROTECTED]>
> > # Date 1224275142 -7200
> > # Node ID cc4a46c7e373a6a0f5d862df670a34bb55340808
> > # Parent  8ccb624da5588dd936572ef219bcc9a393f4e63a
> > hgtk: Overwrite current-dir in sys.path
> >
> > The documentation for Python 2.5.2 states that sys.path[0], is
> > the directory containing the script that was used to invoke the
> > Python interpreter. If the script directory is not available
> > (e.g. if the interpreter is invoked interactively or if the
> > script is read from standard input), path[0] is the empty
> > string, which directs Python to search modules in the current
> > directory first. Notice that the script directory is inserted
> > before the entries inserted as a result of PYTHONPATH. A program
> > is free to modify this list for its own purposes.
> >
> > This is really mostly important to developers of TortoiseHg.
> > If you have several clones of the THG repository and you
> > invoke hgtk inside one of them, you will not use the code you
> > have asked for with TORTOISEHG_PATH, but the code in the current
> > directory.
>
> I am confused. If this is to help development, then shouldn't it be
> more convenient to allow developer to use the code in current
> [development] directory, overriding TORTOISEHG_PATH defined in env?
> Else we will always have to remember to point TORTOISEHG_PATH to the
> directory where you want to test/develop hgtk, which can be very
> confusing.
>
> IMO,  TORTOISEHG_PATH should be the last place we look.


In general, I expect code to treat specialized environment variables as
having higher priority than default values. Also, on Unix systems I never
have '.' (current dir) in my shell PATH variable.

But maybe my understanding is just because I'm new to python, this may be
the expected behaviour for python programs. After all, it is the default for
sys.path to work this way.

Regards,
Peer
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to