Issue1376
Created on 2007-11-02 23:13 by giampaolo.rodola, last changed 2007-11-03 15:17 by gvanrossum.
|
msg57077 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) |
Date: 2007-11-02 23:13 |
|
uu module on line 53 erroneously tries to catch an AttributeError
exception type.
try:
mode = os.stat(in_file).st_mode
except AttributeError:
pass
This is not correct since os.stat(), as far as I know, should raise
OSError exceptions only.
This would turn in an error in case we pass a "broken" symlink as
in_file argument.
|
|
msg57083 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-11-03 15:17 |
|
You misunderstand. The try/except is there in case os.stat isn't defined
or its result doesn't have a st_mode attribute. If the stat operation
fails due to a problem with the file, there's not much point in proceeding
since the subsequent open() call would fail the same way.
|
|
| Date |
User |
Action |
Args |
| 2007-11-03 15:17:45 | gvanrossum | set | status: open -> closed resolution: invalid messages:
+ msg57083 nosy:
+ gvanrossum |
| 2007-11-02 23:13:53 | giampaolo.rodola | create | |
|