Re: [Python-Dev] confusing exec error message in 3.0

2008-08-28 Thread Steve Holden
Guido van Rossum wrote: On Wed, Aug 27, 2008 at 6:21 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 28 Aug 2008 08:39:01 am Georg Brandl wrote: Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError:

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-28 Thread Greg Ewing
Steven D'Aprano wrote: I don't think M.__file__ should lie and say it was loaded from a file that it wasn't loaded from. It's useful to be able to look at a module and see what file it was actually loaded from. On the other hand, it could be useful to be able to find the source file for a

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-28 Thread Isaac Morland
On Fri, 29 Aug 2008, Greg Ewing wrote: Steven D'Aprano wrote: I don't think M.__file__ should lie and say it was loaded from a file that it wasn't loaded from. It's useful to be able to look at a module and see what file it was actually loaded from. On the other hand, it could be useful to

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-28 Thread Guido van Rossum
2008/8/28 Steve Holden [EMAIL PROTECTED]: Guido van Rossum wrote: On Wed, Aug 27, 2008 at 6:21 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 28 Aug 2008 08:39:01 am Georg Brandl wrote: Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last):

[Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Fredrik Lundh
(using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError: exec() arg 1 must be a string, file, or code object, not TextIOWrapper so what's file referring to here? (the above works under 2.5, of course) /F

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Fredrik Lundh
Fredrik Lundh wrote: (using 3.0a4) ahem. I could have sworn that I installed a beta, but I guess the Windows builds weren't fully synchronized when I did that. I still get the same error after updating to 3.0b2, though. (the download page still says This is an alpha release, btw.) /F

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Georg Brandl
Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError: exec() arg 1 must be a string, file, or code object, not TextIOWrapper so what's file referring to here? (the above works under 2.5, of course)

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Michael Foord
Georg Brandl wrote: Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError: exec() arg 1 must be a string, file, or code object, not TextIOWrapper so what's file referring to here? (the above works under

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Guido van Rossum
2008/8/27 Fredrik Lundh [EMAIL PROTECTED]: Fredrik Lundh wrote: (using 3.0a4) ahem. I could have sworn that I installed a beta, but I guess the Windows builds weren't fully synchronized when I did that. I still get the same error after updating to 3.0b2, though. It's still there. It's a

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Steven D'Aprano
On Thu, 28 Aug 2008 08:39:01 am Georg Brandl wrote: Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError: exec() arg 1 must be a string, file, or code object, not TextIOWrapper so what's file

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Guido van Rossum
On Wed, Aug 27, 2008 at 6:21 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 28 Aug 2008 08:39:01 am Georg Brandl wrote: Fredrik Lundh schrieb: (using 3.0a4) exec(open(file.py)) Traceback (most recent call last): File stdin, line 1, in module TypeError: exec() arg 1 must

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-27 Thread Steven D'Aprano
On Thu, 28 Aug 2008 01:38:14 pm Guido van Rossum wrote: On Wed, Aug 27, 2008 at 6:21 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: ... I don't think M.__file__ should lie and say it was loaded from a file that it wasn't loaded from. It's useful to be able to look at a module and see what