[ python-Bugs-1348477 ] pydoc seems to run some scripts!

SourceForge.net noreply at sourceforge.net
Tue Nov 8 03:45:19 CET 2005


Bugs item #1348477, was opened at 2005-11-04 12:10
Message generated for change (Comment added) made by etrepum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1348477&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: Demos and Tools
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Olly Betts (olly)
Assigned to: Nobody/Anonymous (nobody)
Summary: pydoc seems to run some scripts!

Initial Comment:
Ubuntu 5.10 "Breezy Badger"
Linux 2.6.10
Python 2.4.2

Running pydoc on some scripts (for example regextest.py
as supplied with python) just seems to hang:

pydoc
/usr/share/doc/python2.4/examples/Demo/comparisons/regextest.py

Feeding it EOF (Ctrl-D) makes it actually generate
documentation and exit.

But as well as showing the documentation, I get output
which appears to be the script actually having run with
itself as an argument!

----------------------------------------------------------------------

>Comment By: Bob Ippolito (etrepum)
Date: 2005-11-07 21:45

Message:
Logged In: YES 
user_id=139309

Some scripts are broken, this one is missing a check to see if it's a script 
or a module:
if __name__ == "__main__": main()

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1348477&group_id=5470


More information about the Python-bugs-list mailing list