Fixed a unicode related issue in the Python3 debugger backend. 5_0_x

Thu, 21 Oct 2010 08:56:23 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 21 Oct 2010 08:56:23 +0200
branch
5_0_x
changeset 693
ca35ffad8958
parent 691
e4b2b0a27b4c
child 695
fb128899fd6e

Fixed a unicode related issue in the Python3 debugger backend.

DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python3/DebugClientBase.py	Wed Oct 20 21:00:31 2010 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Thu Oct 21 08:56:23 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