bzr 0.7 release candidate 2

Robey Pointer robey at lag.net
Thu Jan 19 09:59:18 GMT 2006


On 18 Jan 2006, at 7:25, John A Meinel wrote:

> John A Meinel wrote:
>> Martin Pool wrote:
>
> ...
>
>> I tried to run 'bzr selftest', and I got 6 'PermissionDenied'  
>> exceptions
>> from the SFTP transport test. I'm trying to look through them now.
>>
>> John
>> =:->
>>
>
> As I investigated further, I think this is mostly because I installed
> the latest development version of paramiko, which seems to have  
> some bugs.

Oops.  Well, thanks for the bug report. :)


> [...]
> I think you wanted this to be
> matches.sort(lambda x,y: cmp(len(x['host']), len(y['host'])))
>                                                 ^^^
> Otherwise it won't do any sorting.

Heh, I missed that when merging.  Patched.


> I think the bug I'm encountering is that somehow FLAG_PERMISSIONS is
> being set, but st_mode is still 0. I don't know how this is happening,
> but something is doing a 'os.chmod(filename, 0)'

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)


pychecker was really freaking out about SFTPAttributes having  
optional fields, and I came around to its way of thinking, and  
changed that behavior.  It's better to have the fields always there  
-- especially with hasattr broken.

No worries though, it'll be a long while before paramiko 1.6 comes out.

robey





More information about the bazaar mailing list