Extended the AsyncFile class to offer more file attributes. 5_3_x

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 26 Feb 2013 19:33:22 +0100
branch
5_3_x
changeset 2435
6b155392518d
parent 2431
af6dc2ad69d4
child 2437
478409839f62

Extended the AsyncFile class to offer more file attributes.
(grafted from c148e2b8188d45883d28cb5ee01585c4bc112cc3)

DebugClients/Python/AsyncFile.py file | annotate | diff | comparison | revisions
DebugClients/Python3/AsyncFile.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/AsyncFile.py	Sat Feb 23 14:25:36 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	Sat Feb 23 14:25:36 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