This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author farialima
Recipients farialima
Date 2010-03-22.05:22:01
SpamBayes Score 2.2280796e-08
Marked as misclassified No
Message-id <1269235324.89.0.336122945296.issue8198@psf.upfronthosting.co.za>
In-reply-to
Content
When the "pydoc" module is imported, and the sys.stdout is overwriten, a end-of-line is sent to the console (on sdtout) when the help() function is sent.

to reproduce (this is on Python 2.5 but the same happens on Pythjon 3.1):

bash-3.2$ python2.5 -c "import pydoc; import sys; from StringIO import StringIO; sys.stdout = StringIO(); help(sys)"

bash-3.2$ 

(note the one empty line)

whereas:

bash-3.2$ python2.5 -c "import sys; from StringIO import StringIO; sys.stdout = StringIO(); help(sys)"
bash-3.2$ 

(no empty line)

The funny thing is that the difference only occurs if sys.stdout is redirected; if it is not, importing pydoc doesn't change anything to the output:

bash-3.2$ python2.5 -c "import pydoc; import sys; help(sys)" | wc
     256    1298   10690
bash-3.2$ python2.5 -c "import sys; help(sys)" | wc
     256    1298   10690
bash-3.2$ 




Note that this is related to 1700304, but is actually *one specific case* since *only one character* is not redirected - I would expect them all or none
History
Date User Action Args
2010-03-22 05:22:04farialimasetrecipients: + farialima
2010-03-22 05:22:04farialimasetmessageid: <1269235324.89.0.336122945296.issue8198@psf.upfronthosting.co.za>
2010-03-22 05:22:02farialimalinkissue8198 messages
2010-03-22 05:22:01farialimacreate