reopen 455890
retitle 455890 "Pychess fails to start if the PYTHONPATH is redefined"
thanks
On Dec 13, 2007 11:14 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> > Let me first close the bug :-)
>
> I disagree with closing the bug, see below.
Okay, I have reopened the bug and retitled it.
>
> >
> > 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.
Yes, I agree with you. I shall forward this report upstream and
discuss with them.
Thanks
Varun
--
Varun Hiremath
Undergraduate Student,
Aerospace Engineering Department,
Indian Institute of Technology Madras,
Chennai, India
------------------------------------------------------
Homepage : http://varun.travisbsd.org
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]