We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5eed6af commit 2c0958fCopy full SHA for 2c0958f
bpython/pager.py
@@ -29,6 +29,8 @@
29
import sys
30
import shlex
31
32
+from bpython._py3compat import py3
33
+
34
35
def get_pager_command(default='less -rf'):
36
command = shlex.split(os.environ.get('PAGER', default))
@@ -51,7 +53,7 @@ def page(data, use_internal=False):
51
53
curses.endwin()
52
54
try:
55
popen = subprocess.Popen(command, stdin=subprocess.PIPE)
- if isinstance(data, unicode):
56
+ if py3 or isinstance(data, unicode):
57
data = data.encode(sys.__stdout__.encoding, 'replace')
58
popen.stdin.write(data)
59
popen.stdin.close()
0 commit comments