Message132474
The interactive help-method provided by python crashes when no stdin-stream is available (sys.stdin == None).
Exception:
Traceback (most recent call last):
File "MyScript", line 4, in <module>
File "C:\Python32\lib\site.py", line 457, in __call__
return pydoc.help(*args, **kwds)
File "C:\Python32\lib\pydoc.py", line 1748, in __call__
self.help(request)
File "C:\Python32\lib\pydoc.py", line 1795, in help
else: doc(request, 'Help on %s:', output=self._output)
File "C:\Python32\lib\pydoc.py", line 1537, in doc
pager(render_doc(thing, title, forceload))
File "C:\Python32\lib\pydoc.py", line 1345, in pager
pager = getpager()
File "C:\Python32\lib\pydoc.py", line 1352, in getpager
if not sys.stdin.isatty() or not sys.stdout.isatty():
AttributeError: 'NoneType' object has no attribute 'isatty'
I think that this situation should be handled:
- either by raising a clear error message indicating that help cannot be displayed because Python is executing in a non-interactive mode
- either by simply printing documentation to stdout (like this: "print(sys.__doc__)") |
|
Date |
User |
Action |
Args |
2011-03-29 09:26:04 | palm.kevin | set | recipients:
+ palm.kevin |
2011-03-29 09:26:04 | palm.kevin | set | messageid: <1301390764.04.0.564019544953.issue11709@psf.upfronthosting.co.za> |
2011-03-29 09:26:03 | palm.kevin | link | issue11709 messages |
2011-03-29 09:26:03 | palm.kevin | create | |
|