[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset baca52bb5c74 by Benjamin Peterson in branch '3.4': make sure the builtin help function doesn't fail when sys.stdin is not a valid file (closes #11709) http://hg.python.org/cpython/rev/baca52bb5c74 New changeset 1a9c07880a15 by Benjamin Peterson in

[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread B D
B D added the comment: I've updated the unit test and have verified that it does fail when the original patch is not included. I also ran make patchcheck again and re-ran all of the tests. This should be good to go. Thanks for your insights, Benjamin. -- Added file: http://bugs.python.

[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Unfortunately, the test doesn't fail without the fix in, probably because the pager() function replaces itself in the module and thus can only be called once. It might make more sense to just directly test the getpager function with sys.stdin = None. -

[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread B D
B D added the comment: removed comments. -- Added file: http://bugs.python.org/file35531/issue11709.patch ___ Python tracker ___ ___ P

[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread B D
B D added the comment: added try finally as suggested by berkerpeksag. make patchcheck still works and all test cases still pass. did not use the test.support.swap_attr context manager because it may inhibit readability for those that are not familiar with it. -- Added file: http://bu

[issue11709] help-method crashes if sys.stdin is None

2014-06-07 Thread B D
B D added the comment: added unit test for this behavior with roxane. verified that the updated patch applies cleanly, passes make patch check, and unit tests all pass. -- nosy: +bdettmer, roxane Added file: http://bugs.python.org/file35523/issue11709.patch

[issue11709] help-method crashes if sys.stdin is None

2014-04-26 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for reporting this, palm.kevin, and thanks for the patch, amaury.forgeotdarc. First, just to be explicit here's a short reproducer: import sys sys.stdin = None help(1) (Note that to get to the isatty check you need to provide an argument and

[issue11709] help-method crashes if sys.stdin is None

2011-03-29 Thread Palm Kevin
Palm Kevin added the comment: I embed Python into an existing, external C application. In addition to this I extend Python to access that app from Python. I do never set explicitly set the standard input to NULL. I guess that the external C application does this... -- ___

[issue11709] help-method crashes if sys.stdin is None

2011-03-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The code fails precisely when checking that sys.stdin is a valid terminal. See the attached patch for a fix. Out of curiosity, why did you set sys.stdin to None? -- keywords: +patch nosy: +amaury.forgeotdarc stage: -> patch review Added file: h

[issue11709] help-method crashes if sys.stdin is None

2011-03-29 Thread Palm Kevin
Changes by Palm Kevin : -- components: +IO type: -> crash versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue11709] help-method crashes if sys.stdin is None

2011-03-29 Thread Palm Kevin
New submission from Palm Kevin : 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 File "C:\Python32\lib\site.py", line 457, in __call__ return p