Skip to content

Commit 3ec1383

Browse files
committed
Make pager work with Python 3.
1 parent d000f8f commit 3ec1383

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bpython/pager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def page(data, use_internal=False):
5050
curses.endwin()
5151
try:
5252
popen = subprocess.Popen(command, stdin=subprocess.PIPE)
53+
if isinstance(data, unicode):
54+
data = data.encode(sys.__stdout__.encoding, 'replace')
5355
popen.stdin.write(data)
5456
popen.stdin.close()
5557
except OSError, e:

0 commit comments

Comments
 (0)