Fixed a unicode related issue in the Python3 debugger backend.

Thu, 21 Oct 2010 08:54:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 21 Oct 2010 08:54:49 +0200
changeset 692
5c2d7b6d47cb
parent 690
a2f8b36625e6
child 694
d482fc1249b0

Fixed a unicode related issue in the Python3 debugger backend.

DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
diff -r a2f8b36625e6 -r 5c2d7b6d47cb DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Wed Oct 20 20:57:08 2010 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Thu Oct 21 08:54:49 2010 +0200
@@ -338,7 +338,7 @@
         @param mode kind of code to be generated (string, exec or eval)
         @return compiled code object (None in case of errors)
         """
-        with open(filename) as fp:
+        with open(filename, encoding = self.__coding) as fp:
             statement = fp.read()
         
         try:
@@ -520,7 +520,8 @@
                 
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 sys.modules['__main__'] = self.debugMod
-                exec(open(sys.argv[0]).read(), self.debugMod.__dict__)
+                exec(open(sys.argv[0], encoding = self.__coding).read(), 
+                     self.debugMod.__dict__)
                 self.writestream.flush()
                 return
 
@@ -549,7 +550,7 @@
                     self.prof.erase()
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 sys.modules['__main__'] = self.debugMod
-                fp = open(sys.argv[0])
+                fp = open(sys.argv[0], encoding = self.__coding)
                 try:
                     script = fp.read()
                 finally:
@@ -587,7 +588,8 @@
                 sys.modules['__main__'] = self.debugMod
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 self.cover.start()
-                exec(open(sys.argv[0]).read(), self.debugMod.__dict__)
+                exec(open(sys.argv[0], encoding = self.__coding).read(), 
+                     self.debugMod.__dict__)
                 self.cover.stop()
                 self.cover.save()
                 self.writestream.flush()

eric ide

mercurial