So is exec(tokenize.open(file).read()) the actual replacement for execfile()? 
Not too bad, but still not obvious (or widely promoted - I'd never heard of it).

Top-posted from my Windows Phone
________________________________
From: Nick Coghlan<mailto:[email protected]>
Sent: ‎6/‎14/‎2014 18:31
To: Steve Dower<mailto:[email protected]>
Cc: Greg Ewing<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Criticism of execfile() removal in Python3


On 15 Jun 2014 09:37, "Steve Dower" 
<[email protected]<mailto:[email protected]>> wrote:
>
> I think the point is that the encoding may be embedded in the file as a 
> coding comment and there's no obvious way to deal with that.

Opening source files correctly is the intended use case for tokenize.open().

Cheers,
Nick.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to