Robert Brewer wrote: > Completely understood about LocalSystem. But IMO, os.stat should > raise a more specific and correct error. As you pointed out, calling > open() raises "IOError: [Errno 13] Permission denied"; it would be > nice if stat did the same (in my example). The platform-specific API > call (for example, Windows _stati64) doesn't provide this--it would > require another test inside posix_do_stat to return a more > appropriate error. But it would be a nice touch for us end-users. No. Python faking up errors that the platform doesn't provide is evil. You are entitled to precisely the error that the platform reported. Now, MSVC stat() is severely constraint, in several ways (e.g. it doesn't support sub-second time-stamps, either), so rewriting stat with plain Win32 API might be reasonable, at which point giving more precise error would be an option. > In my opinion, "no such file" is the wrong error message and is > therefore a bug. But I can accept others disagreeing, since os.stat() > simply wraps Windows' _stat* calls (at least, in my example). It sure looks like a bug - but one of msvcrt.dll. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4