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