This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ledave123
Recipients ledave123, vstinner
Date 2011-08-31.18:20:45
SpamBayes Score 0.0022021688
Marked as misclassified No
Message-id <1314814846.73.0.220167179469.issue12636@psf.upfronthosting.co.za>
In-reply-to
Content
Here is the patch:

diff -r e8da570d29a8 Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py    Wed Jul 27 21:28:23 2011 +0200
+++ b/Lib/idlelib/PyShell.py    Wed Aug 31 20:16:38 2011 +0200
@@ -582,7 +582,9 @@
     def execfile(self, filename, source=None):
         "Execute an existing file"
         if source is None:
-            source = open(filename, "r").read()
+            import tokenize
+            with tokenize.open(filename) as filein:
+                source = filein.read()
         try:
             code = compile(source, filename, "exec")
         except (OverflowError, SyntaxError):

Sorry for taking such a long time, I was on holidays.
History
Date User Action Args
2011-08-31 18:20:46ledave123setrecipients: + ledave123, vstinner
2011-08-31 18:20:46ledave123setmessageid: <1314814846.73.0.220167179469.issue12636@psf.upfronthosting.co.za>
2011-08-31 18:20:46ledave123linkissue12636 messages
2011-08-31 18:20:45ledave123create