Bugs item #1289210, was opened at 2005-09-12 19:23 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1289210&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Windows Group: Python 2.4 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Colin J. Williams (cjwhrh) Assigned to: Nobody/Anonymous (nobody) Summary: PyDoc crashes at os.py line 133 Initial Comment: Details of the attempted runs are given below: C:\Python24\Lib>python pydoc.py sys Help on built-in module sys: NAME sys FILE (built-in) MODULE DOCS http://www.python.org/doc/current/lib/module-sys.html etc. etc. ------------------------------------------------------------------------------------------------------------ The above works OK but the following - advertised in the PyDoc.py comment - fails. ----------------------------------------------------------------------------------------------------------- C:\Python24\Lib>pydoc sys 'import site' failed; use -v for traceback Traceback (most recent call last): File "C:\Python24\Lib\pydoc.py", line 54, in ? import sys, imp, os, re, types, inspect, __builtin__ File "C:\Python24\Lib\os.py", line 133 from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep, ^ SyntaxError: invalid syntax ------------------------------------------------------------------------------------------------------------ Lines 132 to 134 of os.py: sys.modules['os.path'] = path from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep, devnull) ------------------------------------------------------------------------------------------------ The above "from X import" usage appears legitimate. Colin W. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2005-09-13 07:02 Message: Logged In: YES user_id=80475 When you write, "pydoc sys", your relying on a file association for py files to get run by python23. The association is not controlled by the PYTHON environment variable. Anyway, it is evident from the initial report that there is not a bug. When "python pydoc.py sys" runs fine, it means that your sys file is okay. When it fails using "pydoc sys" it means an earlier version of the interpreter is being run on the Py2.4 sys file. To convince yourself, change to c:\python23\lib and run "pydoc sys". ---------------------------------------------------------------------- Comment By: Colin J. Williams (cjwhrh) Date: 2005-09-13 06:15 Message: Logged In: YES user_id=285587 Response to R Hettinger 2005-09-13 00:10 I do have Python 2.4 and 2.3 installed but the environment variable PYTHON is set to C:\Python24. I have checked to see that no Python process is running before repeating the test this morning. I get the same results. Is there any other check I should make? Colin W. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2005-09-12 23:10 Message: Logged In: YES user_id=80475 This is probably invalid. It looks like you may have multiple python versions running on your system and that the pydoc batch file is invoking an earlier version of the interpreter that doesn't understand multiline imports). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1289210&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com