[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grass-dev
Subject:    [GRASS-dev] Re: [GRASS-user] Grass 6.4 & python.
From:       Colin Nielsen <colin.nielsen () gmail ! com>
Date:       2009-04-30 14:31:42
Message-ID: d4e057e20904300731h510fd043v6c49312be082512a () mail ! gmail ! com
[Download RAW message or body]

I've updated the CompileOnWindows page to reflect this improved
PYTHONPATH, and I'll add it to the native installer in the next
version. Thanks.

-Colin

On Thu, Apr 30, 2009 at 12:03 AM, Hamish <hamish_b@yahoo.com> wrote:
>
>> # Set the PYTHONPATH variable
>> PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25:$PYTHONPATH"
>> export PYTHONPATH
>
> I don't know if it matters much for PYTHONPATH, but there is a small
> issue with $PATH if set as above. If $PYTHONPATH is previously empty
> then the search path becomes:
>  $GISBASE/etc/python:$GISBASE/Python25:
>
> The final ":" at the end causes the pwd (".") to be added to the path.
> that isn't always a problem but it can lead to unexpected results.
>
> if the "$EMPTY:" comes first in the $PATH then it is more of a problem
> because the unexpected copy is run not the system copy. e.g. it's a lot
> easier for a nasty person to inject a program called "ls" into your home
> directory and trick you into running it by mistake.
>
> so longer but better is
>
> if [ -z "$PYTHONPATH" ] ; then
>  PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25"
> else
>  PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25:$PYTHONPATH"
> fi
> export PYTHONPATH
>
>
> Hamish
>
>
>
>
>
>
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic