Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #192 from mlubimow/master---fix_remote_non_ascii_i…
Browse files Browse the repository at this point in the history
…ssue

Fixed issue with debugging apps with non-ascii data
  • Loading branch information
inducer committed Jul 6, 2016
2 parents 255f318 + 7ccbd53 commit f46002a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pudb/remote.py
Expand Up @@ -69,7 +69,17 @@ def __init__(self, host=PUDB_RDB_HOST, port=PUDB_RDB_PORT,
# makefile ignores encoding if there's no buffering.
raw_sock_file = self._client.makefile("rwb", 0)
import codecs
sock_file = codecs.StreamReaderWriter(raw_sock_file,

if sys.version_info[0] < 3:
sock_file = codecs.StreamRecoder(
raw_sock_file,
codecs.getencoder("utf-8"),
codecs.getdecoder("utf-8"),
codecs.getreader("utf-8"),
codecs.getwriter("utf-8"))
else:
sock_file = codecs.StreamReaderWriter(
raw_sock_file,
codecs.getreader("utf-8"),
codecs.getwriter("utf-8"))

Expand Down

0 comments on commit f46002a

Please sign in to comment.