[MERGE][0.15] handle ERROR_DIRECTORY for win32 "bzr status filename"

John Arbash Meinel john at arbash-meinel.com
Tue Mar 20 18:47:26 GMT 2007


Alexander Belchenko wrote:
...

>> e_errno = getattr(e, 'errno', None)
>> e_winerror = getattr(e, 'winerror', None)
> 
>> if e_errno in (...) or e_winerror in (...)
> 
>> Something like that should make it reasonably easy, but I would need
>> someone to test a bit to see what actual errors python 2.5 is raising.
> 
> Python 2.5 @ Windows XP
> 
> C:\work\Bazaar\sandbox\bzr.dev>type test_winerror.py
> import os
> try:
>     os.listdir('bzr')
> except OSError, e:
>     print 'e:', e
>     print 'dir:', dir(e)
>     print 'errno:', e.errno
>     print 'winerror:', e.winerror
> 
> C:\work\Bazaar\sandbox\bzr.dev>test_winerror.py
> e: [Error 22] : 'bzr/*.*'
> dir: ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__getitem__',
> '__hash__', '__init__',
> '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__str__',
> 'args', 'errno', 'filename', 'message', 'strerror', 'winerror']
> errno: 22
> winerror: 267
> 
> 
> [µ]

It seems reasonable to actually include EINVAL (22) along with ENOENT
and ENOTDIR.

John
=:->




More information about the bazaar mailing list