[Patches] [ python-Patches-448227 ] execfile(dir) no longer works

noreply@sourceforge.net noreply@sourceforge.net
Sun, 05 Aug 2001 13:05:31 -0700


Patches item #448227, was opened at 2001-08-05 13:05
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=448227&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Titus Brown (titus)
Assigned to: Nobody/Anonymous (nobody)
Summary: execfile(dir) no longer works

Initial Comment:
'execfile(".")' succeeds w/o an error in the current
implementation.  I'm not sure why the _parse itself_
succeeds, but because a directory can be opened by
fopen() for reading, the check in execfile itself
succeeds.

I added in a check (via stat()) to see if the filename
given is a directory.  If it is, execfile raises an
IOError (same as for filename not existing).  I'm
perfectly willing to admit that this may not be the
best solution ;), but it's less nonintuitive than the
current behavior.



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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=448227&group_id=5470