@@ -66,9 +66,11 @@ def __init__(self, locals=None, encoding=sys.getdefaultencoding()):
6666
6767 if not py3 :
6868
69- def runsource (self , source , filename = '<input>' , symbol = 'single' ):
70- source = '# coding: %s\n %s' % (self .encoding ,
71- source .encode (self .encoding ))
69+ def runsource (self , source , filename = '<input>' , symbol = 'single' ,
70+ encode = True ):
71+ if encode :
72+ source = '# coding: %s\n %s' % (self .encoding ,
73+ source .encode (self .encoding ))
7274 return code .InteractiveInterpreter .runsource (self , source ,
7375 filename , symbol )
7476
@@ -305,7 +307,7 @@ def __init__(self, interp, config, idle=None):
305307 filename = os .environ .get ('PYTHONSTARTUP' )
306308 if filename and os .path .isfile (filename ):
307309 with open (filename , 'r' ) as f :
308- self .interp .runsource (f .read (), filename , 'exec' )
310+ self .interp .runsource (f .read (), filename , 'exec' , encode = False )
309311
310312 def attr_matches (self , text ):
311313 """Taken from rlcompleter.py and bent to my will."""
0 commit comments