Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydoc seems to run some scripts! #42552

Closed
olly mannequin opened this issue Nov 4, 2005 · 5 comments
Closed

pydoc seems to run some scripts! #42552

olly mannequin opened this issue Nov 4, 2005 · 5 comments

Comments

@olly
Copy link
Mannequin

olly mannequin commented Nov 4, 2005

BPO 1348477
Nosy @etrepum

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-11-09.07:09:28.000>
created_at = <Date 2005-11-04.17:10:42.000>
labels = []
title = 'pydoc seems to run some scripts!'
updated_at = <Date 2005-11-09.07:09:28.000>
user = 'https://bugs.python.org/olly'

bugs.python.org fields:

activity = <Date 2005-11-09.07:09:28.000>
actor = 'nnorwitz'
assignee = 'nnorwitz'
closed = True
closed_date = None
closer = None
components = ['Demos and Tools']
creation = <Date 2005-11-04.17:10:42.000>
creator = 'olly'
dependencies = []
files = []
hgrepos = []
issue_num = 1348477
keywords = []
message_count = 5.0
messages = ['26798', '26799', '26800', '26801', '26802']
nosy_count = 3.0
nosy_names = ['nnorwitz', 'bob.ippolito', 'olly']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1348477'
versions = ['Python 2.4']

@olly
Copy link
Mannequin Author

olly mannequin commented Nov 4, 2005

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!

@olly olly mannequin closed this as completed Nov 4, 2005
@olly olly mannequin assigned nnorwitz Nov 4, 2005
@olly olly mannequin closed this as completed Nov 4, 2005
@olly olly mannequin assigned nnorwitz Nov 4, 2005
@etrepum
Copy link
Mannequin

etrepum mannequin commented Nov 8, 2005

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()

@olly
Copy link
Mannequin Author

olly mannequin commented Nov 8, 2005

Logged In: YES
user_id=14972

So I guess this is a bug report for that missing check in
regextest.py in the python distribution.

Is running a script which is missing this check an inherent
feature of how pydoc works then?

@etrepum
Copy link
Mannequin

etrepum mannequin commented Nov 8, 2005

Logged In: YES
user_id=139309

pydoc imports modules, it doesn't run scripts. It just so happens that
regextest isn't written correctly and does things it shouldn't do when
imported.

You should file a new bug on regextest.py, or at least change the summary
accordingly... but a new bug would end up in the summary again, and
would be more likely to be fixed.

@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Nov 9, 2005

Logged In: YES
user_id=33168

I'm feeling generous tonight. :-)

Thanks for the report. I updated regextest program.

Committed revision 41414.
Committed revision 41415. (2.4)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants