Extended the AsyncFile class to offer more file attributes.

Tue, 26 Feb 2013 19:33:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 26 Feb 2013 19:33:22 +0100
changeset 2434
c148e2b8188d
parent 2433
f580320cd0aa
child 2436
f75dbdd22959

Extended the AsyncFile class to offer more file attributes.

DebugClients/Python/AsyncFile.py file | annotate | diff | comparison | revisions
DebugClients/Python3/AsyncFile.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/AsyncFile.py	Mon Feb 25 18:32:53 2013 +0100
+++ b/DebugClients/Python/AsyncFile.py	Tue Feb 26 19:33:22 2013 +0100
@@ -48,6 +48,7 @@
         self.mode = mode
         self.name = name
         self.nWriteErrors = 0
+        self.encoding = "utf-8"
 
         self.wpending = u''
 
@@ -73,7 +74,7 @@
             try:
                 buf = "%s%s" % (self.wpending[:n], EOT)
                 try:
-                    buf = buf.encode('utf8')
+                    buf = buf.encode('utf-8')
                 except (UnicodeEncodeError, UnicodeDecodeError):
                     pass
                 self.sock.sendall(buf)
--- 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