[Python-bugs-list] [ python-Bugs-599163 ] execfile() not show filename when IOErro

noreply@sourceforge.net noreply@sourceforge.net
Tue, 03 Sep 2002 12:40:07 -0700


Bugs item #599163, was opened at 2002-08-23 06:16
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=599163&group_id=5470

Category: Python Library
Group: Python 2.2.1
Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Inyeol Lee (inyeol)
>Assigned to: Peter Schneider-Kamp (nowonder)
Summary: execfile() not show filename when IOErro

Initial Comment:
Python 2.2.1 (#1, Apr 10 2002, 18:25:16) 
[GCC 2.95.3 20010315 (release)] on sunos5
>>> try: execfile('non_existent_file')
... except IOError, msg: msg.__dict__

{'errno': 2, 'args': (2, 'No such file or directory'),
'strerror': 'No such file or directory', 'filename':
None}

There should be a filename, not None.

-Inyeol Lee 

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-09-03 15:40

Message:
Logged In: YES 
user_id=6380

Credit where credit is due. :-)

----------------------------------------------------------------------

Comment By: Peter Schneider-Kamp (nowonder)
Date: 2002-08-27 12:59

Message:
Logged In: YES 
user_id=14463

execfile incorrectly called PyErr_SetFromErrno instead of
PyErr_SetFromErrnoWithFilename.

Resolution is obvious and already committed to cvs.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=599163&group_id=5470