mirror of
https://github.com/kennethreitz-archive/bpython-gist.git
synced 2026-06-05 23:50:18 +00:00
Unicode + string concatenation bug in output bufffer fixed
Thanks to Mark Florisson for the patch.
This commit is contained in:
@@ -12,6 +12,10 @@ stdout or not on exit.
|
||||
Piping something to bpython made it lock up as stdin was not the keyboard -
|
||||
bpython just executes stdin and exits instead of trying to do something clever.
|
||||
|
||||
Mark Florisson (eggy) gave me a patch that stops weird breakage when unicode
|
||||
objects get added into the output buffer - they now get encoded into the output
|
||||
encoding.
|
||||
|
||||
v0.7.1
|
||||
======
|
||||
Added support for a history file, defaults to ~/.pythonhist and 100 lines but
|
||||
|
||||
@@ -950,6 +950,9 @@ class Repl(object):
|
||||
else:
|
||||
t = s
|
||||
|
||||
if isinstance(t, unicode):
|
||||
t = t.encode(sys.__stdout__.encoding)
|
||||
|
||||
if not self.stdout_hist:
|
||||
self.stdout_hist = t
|
||||
else:
|
||||
@@ -982,6 +985,8 @@ class Repl(object):
|
||||
uses the formatting method as defined in formatter.py to parse the
|
||||
srings. It won't update the screen if it's reevaluating the code (as it
|
||||
does with undo)."""
|
||||
if isinstance(s, unicode):
|
||||
s = s.encode(sys.__stdout__.encoding)
|
||||
|
||||
a = curses.color_pair(0)
|
||||
if '\x01' in s:
|
||||
|
||||
Reference in New Issue
Block a user