> The default replacement should be really providing a new execfile that
> gets the encoding in the first 2 lines and opens it with the proper
> encoding set (and properly closes the stream).
No. The default replacement should really open the file in binary mode.
Regards,
Martin
--
http://mail.p
Right now, it seems that the default implementation of execfile in
2to3 is something as:
exec(compile(open(file).read()+"\n", file, 'exec'), globals, locals)
But it seems it won't deal with encodings properly... and also, in
CPython just making an open without a close is OK, because of the
refere