Fixed encoding on urlview input, #256.

This commit is contained in:
Michael Lazar
2016-07-22 23:24:25 -07:00
parent aa29415fe1
commit feb2dc1894

View File

@@ -381,7 +381,7 @@ class Terminal(object):
try:
with self.suspend():
p = subprocess.Popen([pager], stdin=subprocess.PIPE)
p.stdin.write(self.clean(data))
p.stdin.write(data.encode('utf-8'))
p.stdin.close()
try:
p.wait()
@@ -450,15 +450,14 @@ class Terminal(object):
urlview = os.getenv('RTV_URLVIEWER') or 'urlview'
try:
with self.suspend():
p = subprocess.Popen([urlview],
stdin=subprocess.PIPE)
p = subprocess.Popen([urlview], stdin=subprocess.PIPE)
try:
p.communicate(input=six.b(data))
p.communicate(input=data.encode('utf-8'))
except KeyboardInterrupt:
p.terminate()
except OSError:
self.show_notification(
'Could not open urls with {}'.format(urlview))
'Failed to open {0}'.format(urlview))
def text_input(self, window, allow_resize=False):
"""