bzr 0.7 release candidate 2
John A Meinel
john at arbash-meinel.com
Thu Jan 19 15:56:15 GMT 2006
Robert Collins wrote:
> On Thu, 2006-01-19 at 01:59 -0800, Robey Pointer wrote:
>
>> It took me embarrassingly long to figure this out tonight.
>> stub_sftp.py is relying on the hasattr check, and needs to be patched
>> like so:
>>
>> === modified file 'bzrlib/tests/stub_sftp.py'
>> --- bzrlib/tests/stub_sftp.py
>> +++ bzrlib/tests/stub_sftp.py
>> @@ -117,7 +117,7 @@
>> try:
>> if hasattr(os, 'O_BINARY'):
>> flags |= os.O_BINARY
>> - if (attr is not None) and hasattr(attr, 'st_mode'):
>> + if (attr is not None) and hasattr(attr, 'st_mode') and
>> attr.st_mode != 0:
>> fd = os.open(path, flags, attr.st_mode)
>> else:
>> fd = os.open(path, flags)
>
>
> I would write that as:
> if getattr(attr, 'st_mode', 0) != 0:
>
>
> Cheers,
> Rob
I'm curious why Robey is using '0' instead of using 'None'. None can't
be confused for a valid mode. But anyway, we certainly should put some
sort of fix into the bzr. I didn't see anything wrong with paramiko, so
I'm glad we found the problem.
By the way, +1 to the getattr() fix, is that enough to get it into
integration?
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060119/104cc412/attachment.pgp
More information about the bazaar
mailing list