[issue3192] exec(open(filename)) doesn't work

2008-06-26 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- resolution: -> duplicate status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3192] exec(open(filename)) doesn't work

2008-06-25 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: issue 1762972 supercedes this. -- nosy: +brett.cannon superseder: -> 'exec' does not accept what 'open' returns ___ Python tracker <[EMAIL PROTECTED]>

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Leif Walsh
Leif Walsh <[EMAIL PROTECTED]> added the comment: execfile is in Lib/idlelib/PyShell.py, and is an instance function, so it's not really standard for regular code, and would also be hard to use correctly. Sorry. ___ Python tracker <[EMAIL PROTECTED]>

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Mike Speciner
Mike Speciner <[EMAIL PROTECTED]> added the comment: Well, I think I found exec in bltinmodule.c, but execfile isn't in that file. [In the 3.0 tree.] ___ Python tracker <[EMAIL PROTECTED]>

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Leif Walsh
Leif Walsh <[EMAIL PROTECTED]> added the comment: (isn't gone, that is) ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Leif Walsh
Leif Walsh <[EMAIL PROTECTED]> added the comment: On Tue, Jun 24, 2008 at 3:05 PM, Mike Speciner <[EMAIL PROTECTED]> wrote: > By the way, I was told that execfile is gone from python 3. It certainly isn't in the branch I just checked out. ___ Python tracker <

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Mike Speciner
Mike Speciner <[EMAIL PROTECTED]> added the comment: I'm actually quite new to Python. My current interpreter of choice is PostScript, followed by Matlab, but I've been discouraged from using either one here at EMC. (PostScript because it's obscure, Matlab because it's expensive!) Meanwhile, I'm

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Leif Walsh
Leif Walsh <[EMAIL PROTECTED]> added the comment: There's 'execfile' in Lib/idlelib/PyShell.py...I'm looking for others. There is also a class of functions 'exec*' (and a related class, 'spawn*') in Lib/os.py that claims to do just what you want, but replacing the current process (or, in spawn

[issue3192] exec(open(filename)) doesn't work

2008-06-24 Thread Mike Speciner
New submission from Mike Speciner <[EMAIL PROTECTED]>: In 2.5, exec(open(filename)), where filename refers to a file with python code, executes the code. In 2.5, open returns an open file, but in 3.0, open returns a stream, and so exec (which wants "a string, file, or code object, not TextIOWrapp