> Let me first close the bug :-)

I disagree with closing the bug, see below.

>
> Please remove PYTHONPATH from environ or set it to
> /usr/lib/python2.4/site-packages/
>
> See this (from the source code):
>
>  if "PYTHONPATH" in os.environ:
>                 path = os.path.abspath(os.environ["PYTHONPATH"])
>                 path = os.path.join(path, "pychess/Players/PyChess.py")
>             else:
>                 path = os.path.dirname(imp.find_module("os")[1])
>                 path = os.path.join(path,
>                         "site-packages/pychess/Players/PyChess.py")

This fixes the problem:

export -n PYTHONPATH

However, user may redefie PYTHONPATH, and this is a bug in pychess,
see man python:

PYTHONPATH
              Augments  the  default search path for module files.  The format
              is the  same  as  the  shell's  $PATH:  one  or  more  directory
              pathnames  separated  by  colons.   Non-existent directories are
              silently ignored.   The  default  search  path  is  installation
              dependent,  but  generally begins with ${prefix}/lib/python<ver‐
              sion> (see PYTHONHOME above).  The default search path is always
              appended  to  $PYTHONPATH.   If  a script argument is given, the
              directory containing the script is inserted in the path in front
              of  $PYTHONPATH.  The search path can be manipulated from within
              a Python program as the variable sys.path .


So the user may just add some or no directories to PYTHONPATH and the
default path is still appended. Of course, all other python programs
work, only pychess doesn't, because it screwes up the paths.

Ondrej

Reply via email to