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

noreply@sourceforge.net noreply@sourceforge.net
Sun, 05 Aug 2001 14:15:15 -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: 2
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.



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

>Comment By: Martin v. Löwis (loewis)
Date: 2001-08-05 14:15

Message:
Logged In: YES 
user_id=21627

Can you please submit unified (-u) or context (-c) diffs 
in the future? Plain diffs, without context, are hard to 
integrated once the underlying file changes.

As for the IOError, I think you should make sure you get a 
specific errno code, e.g. EISDIR. Would you be willing to 
revise your patch in that direction?


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

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