Permalink
Browse files

Be explicit about the argument to ``bytes.decode``

  • Loading branch information...
1 parent 0bd43f6 commit 9737818451af324db4c031d87d6085dbd4ba72aa @superbobry superbobry committed Jul 3, 2016
Showing with 2 additions and 4 deletions.
  1. +0 −2 examples/capture.py
  2. +1 −1 pyte/screens.py
  3. +1 −1 pyte/streams.py
View
@@ -12,7 +12,6 @@
from __future__ import print_function, unicode_literals
-import codecs
import os
import pty
import select
@@ -28,7 +27,6 @@
stream = pyte.Stream(pyte.Screen(80, 24))
- decoder = codecs.getincrementaldecoder(sys.getdefaultencoding())("replace")
master, slave = pty.openpty()
with open(sys.argv[1], "wb") as handle:
p = subprocess.Popen(sys.argv[2:], stdout=slave, stderr=slave)
View
@@ -429,7 +429,7 @@ def draw(self, data):
if self.charset:
chars = "".join(self.g1_charset[ch] for ch in data)
elif self.use_utf8:
- chars = data.decode()
+ chars = data.decode("utf-8")
else:
chars = "".join(self.g0_charset[ch] for ch in data)
View
@@ -364,7 +364,7 @@ class DebugStream(Stream):
def __init__(self, to=sys.stdout, only=(), *args, **kwargs):
def safe_str(chunk):
if isinstance(chunk, bytes):
- chunk = chunk.decode()
+ chunk = chunk.decode("utf-8")
elif not isinstance(chunk, str):
chunk = str(chunk)

0 comments on commit 9737818

Please sign in to comment.