[Python-Dev] Criticism of execfile() removal in Python3

Paul Moore p.f.moore at gmail.com
Thu Jun 19 22:46:02 CEST 2014


On 19 June 2014 20:39, Joseph Martinot-Lagarde
<joseph.martinot-lagarde at m4x.org> wrote:
> Another way is to open the file in binary, then exec() checks itself if an
> encoding is defined in the file. This is what is used in spyder:
>
> exec(open(file, 'rb').read())
>
> Here is the discussion for reference:
> https://bitbucket.org/spyder-ide/spyderlib/pull-request/3/execution-on-current-spyder-interpreter/diff

It would be good to document this. Could you open a docs bug to get this added?

Paul


More information about the Python-Dev mailing list