Knits escape too many characters
John Arbash Meinel
john at arbash-meinel.com
Fri Apr 21 16:15:16 BST 2006
I realize it is probably too late now that knits have officially landed.
But I was pushing a knit repository using rsync, and I noticed it had
some really weird paths in there.
Specifically, it seems the latest bzr.dev is escaping all sorts of
things. Like even escaping capital letters.
It was escaping this id:
x_John_F_Meinel_Jr_<john at johnmeinel.com>_Fri_Jun_11_00:50:40_2004_2213.0
Into this one
x_%4aohn_%46_%4deinel_%4ar_%3cjohn at johnmeinel.com%3e_%46ri_%4aun_11_00%3a50%3a40_2004_2213.0
I see that the code in question does this:
safe = "abcdefghijklmnopqrstuvwxyz0123456789-_@,."
r = [((c in safe) and c or ('%%%02x' % ord(c)))
for c in file_id]
Now, is this because of concern for file-ids which only differ by case
(such that they could conflict)?
I can see that it might be a good thing. But I would mention that we
probably should factor the escaping code into a separate function, which
has explicit tests for this behavior. And it probably should be
documented (docstring/comment whatever).
Anyway, if there is a specific reason for it, I don't have a big
problem. I just wanted to know.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060421/77d427f0/attachment.pgp
More information about the bazaar
mailing list