bzr 0.7 release candidate 2
John Arbash Meinel
john at arbash-meinel.com
Thu Jan 19 22:38:26 GMT 2006
Robey Pointer wrote:
>
> On 19 Jan 2006, at 7:56, John A Meinel wrote:
>
>> 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.
>
>
> No reason except that I didn't think of it. :) I'll switch it to None
> in paramiko, then use getattr(attr, 'st_mode', None) as a patch against
> bzr.robey.
>
> robey
I already have the getattr() patch in my 0.7 bugfix branch. Which should
make it into 0.7 before it is officially released. (Since it has an
important bugfix in there).
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060119/3c795230/attachment.pgp
More information about the bazaar
mailing list