[BUG][PATCH] fileid_involved fails to unescape xml characters
Robert Collins
robertc at robertcollins.net
Thu Jan 19 21:54:38 GMT 2006
On Thu, 2006-01-19 at 15:29 -0600, John Arbash Meinel wrote:
> === modified file 'bzrlib/tests/stub_sftp.py'
> --- bzrlib/tests/stub_sftp.py
> +++ bzrlib/tests/stub_sftp.py
> @@ -105,7 +105,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 getattr(attr, 'st_mode', None):
In my previous email I meant:
if getattr(attr, 'st_mode', None):
literally: getattr(None, 'foo', 'bar') -> 'bar'
> fd = os.open(path, flags, attr.st_mode)
> else:
> fd = os.open(path, flags)
> @@ -151,7 +151,9 @@
> def mkdir(self, path, attr):
> path = self._realpath(path)
> try:
> - if attr is not None and hasattr(attr, 'st_mode'):
> + # Using getattr() in case st_mode is None or 0
> + # both evaluate to False
> + if attr is not None and getattr(attr, 'st_mode', None):
and here.
+1 from me with that changed, and an assert + comment in
fileid_involved() to ensure that the branch format is in (5, 6) -
because new formats may change the format of inventories - and I really
dont want to know what will happen with mixed-format weaves at that
point if we dont have the converters eyes drawn to this code path.
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/20060120/48be0d68/attachment.pgp
More information about the bazaar
mailing list