From feb2dc1894aba5871f0e09ea7d3a213a100e63a4 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Fri, 22 Jul 2016 23:24:25 -0700 Subject: [PATCH] Fixed encoding on urlview input, #256. --- rtv/terminal.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rtv/terminal.py b/rtv/terminal.py index ec0d952..22c8d8d 100644 --- a/rtv/terminal.py +++ b/rtv/terminal.py @@ -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): """