mspieth / rssdler

Automatically exported from code.google.com/p/rssdler
4 stars 0 forks source link

help(rssdler) less-like behavior broken #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Behavior 1: Broken less-like behavior for help(rssdler)
  0a) help(dict), notice less-like interface to the help output
  0b) restart python interpreter
  1) import breakHelpLess  (makes use of test case instead of module due to
issue 15)
  2) help(breakHelpLess)
  3) notice all the output scrolls immediately, much gets lost in scroll buffer

but NOT

  1) help(dict) (do not restart python)
  2) import breakHelpLess
  3) help(breakHelpLess), less like behavior IS displayed

Behavior 2: rssdler breaks less-like behavior for help(othermodules)
  1) import breakHelpLess
  2) help(dict)
  3) notice output scrolls immediately

BUT NOT

  1) help(dict)
  2) import breakHelpLess
  3) help(dict), notice less-like behavior

this is due to the following lines:

utfWriter = codecs.getwriter( "utf-8" )
sys.stdout = utfWriter( sys.stdout, "replace" )

Attached is a module that will show this behavior in action. We need a way
to make sys.stdout be unicode friendly without breaking this behavior. The
regression was caused by changing sys.stdoutUTF to sys.stdout in r91. 

Original issue reported on code.google.com by lostnihi...@gmail.com on 5 Feb 2008 at 4:44

Attachments:

GoogleCodeExporter commented 8 years ago
print should do encoding for us automatically, as long as the user's terminal 
is set
to handle unicode/utf-8 stuff properly. Changed sys.stdout/err calls to make 
use of
print in r96.

Original comment by lostnihi...@gmail.com on 5 Feb 2008 at 5:55