[patch][win32] Use u'.' not '.' as hardcoded path
John A Meinel
john at arbash-meinel.com
Mon Dec 26 22:08:15 GMT 2005
Alexander Belchenko wrote:
> For win32 we need use base path in unicode form.
>
> Alexander
>
>
> ------------------------------------------------------------------------
>
> === modified file 'bzrlib\\tests\\test_msgeditor.py'
> --- bzrlib\tests\test_msgeditor.py
> +++ bzrlib\tests\test_msgeditor.py
> @@ -28,7 +28,7 @@
>
> def make_uncommitted_tree(self):
> """Build a branch with uncommitted unicode named changes in the cwd."""
> - b = Branch.initialize('.')
> + b = Branch.initialize(u'.')
> working_tree = b.working_tree()
> filename = u'hell\u00d8'
> try:
>
Actually, I think we just need to change either the Branch api, or the
Transport one, so that any string that comes in gets converted into a
unicode string.
So we do something like this:
class BzrBranch...
def initialize(path):
path = unicode(path)
t = get_transport(path)
Though really I think it would probably be best to do this in Transport.
I'm guessing that http and sftp may need to deal differently with
unicode strings, since they will tend to be url encoded, not strait strings.
So LocalTransport should do something like:
def __init__(self, base):
"""Set the base path where files will be stored."""
if base.startswith('file://'):
base = base[7:]
base = unicode(base)
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051226/1c06879b/attachment.pgp
More information about the bazaar
mailing list