bzr 0.7 release candidate 2
Robert Collins
robertc at robertcollins.net
Thu Jan 19 11:05:02 GMT 2006
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
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060119/f7d14c00/attachment.pgp
More information about the bazaar
mailing list