DebugClients/Python3/AsyncFile.py

changeset 2434
c148e2b8188d
parent 2302
f29e9405c851
child 2953
703452a2876f
child 3163
9f50365a0870
--- a/DebugClients/Python3/AsyncFile.py	Mon Feb 25 18:32:53 2013 +0100
+++ b/DebugClients/Python3/AsyncFile.py	Tue Feb 26 19:33:22 2013 +0100
@@ -48,8 +48,8 @@
         self.mode = mode
         self.name = name
         self.nWriteErrors = 0
+        self.encoding = "utf-8"
         
-        self.encoding = "utf-8"
         self.line_buffering = True
         self.errors = None
 
@@ -77,7 +77,7 @@
             try:
                 buf = "{0!s}{1!s}".format(self.wpending[:n], EOT)
                 try:
-                    buf = buf.encode('utf8', 'backslashreplace')
+                    buf = buf.encode('utf-8', 'backslashreplace')
                 except (UnicodeEncodeError, UnicodeDecodeError):
                     pass
                 self.sock.sendall(buf)

eric ide

mercurial