mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #12636: IDLE reads the coding cookie when executing a Python script.
This commit is contained in:
		
							parent
							
								
									85c6772aec
								
							
						
					
					
						commit
						979482a315
					
				
					 2 changed files with 8 additions and 5 deletions
				
			
		|  | @ -1,16 +1,17 @@ | |||
| #! /usr/bin/env python3 | ||||
| 
 | ||||
| import getopt | ||||
| import os | ||||
| import os.path | ||||
| import sys | ||||
| import getopt | ||||
| import re | ||||
| import socket | ||||
| import time | ||||
| import subprocess | ||||
| import sys | ||||
| import threading | ||||
| import time | ||||
| import tokenize | ||||
| import traceback | ||||
| import types | ||||
| import subprocess | ||||
| 
 | ||||
| import linecache | ||||
| from code import InteractiveInterpreter | ||||
|  | @ -572,7 +573,7 @@ def execsource(self, source): | |||
|     def execfile(self, filename, source=None): | ||||
|         "Execute an existing file" | ||||
|         if source is None: | ||||
|             with open(filename, "r") as fp: | ||||
|             with tokenize.open(filename) as fp: | ||||
|                 source = fp.read() | ||||
|         try: | ||||
|             code = compile(source, filename, "exec") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner