[win32][BUG] url to filesystem???
John Arbash Meinel
john at arbash-meinel.com
Fri Jun 9 20:36:54 BST 2006
Alexander Belchenko wrote:
> The newest improvements to url on win32 does not work: I cannot to push
> to local path:
>
> E:\work\MyCode\BJT\Python\bjt-widgets\bjtwidgets.bialix>bzr push
> G:\push\bjt\Python\bjtwidgets.bialix
> bzr: ERROR: Invalid url supplied to transport:
> u'file:///G:/push/bjt/Python/bjtwidgets.bialix/': win32 file:/// paths
> need a drive letter
>
> E:\work\MyCode\BJT\Python\bjt-widgets\bjtwidgets.bialix>bzr push
> "file:///G|\push\bjt\Python\bjtwidgets.bialix"
> bzr: ERROR: Invalid url supplied to transport:
> 'file:///G|\\push\\bjt\\Python\\bjtwidgets.bialix/': Win32 file urls
> start with file:///X|/, where X is a valid drive letter
>
> E:\work\MyCode\BJT\Python\bjt-widgets\bjtwidgets.bialix>bzr push
> "file:///G|/push/bjt/Python/bjtwidgets.bialix"
> bzr: ERROR: Invalid url supplied to transport:
> 'file:///G|/push/bjt/Python/bjtwidgets.bialix/': win32 file:/// paths
> need a drive letter
>
>
> This is new file:/// is something terrible!!!
>
> --
> Alexander
Well, it looks like my 'assert correct' logic just has a bug in that it
doesn't accept the URLs that it supplies. I thought I already checked that.
The code in question seems to be doing:
win32_url = url[len('file:///'):]
if (win32_url[0] not in
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
or win32_url[1] not in '|:'
or win32_url[2] != '/'):
raise errors.InvalidURL(url, 'Win32 file urls start with
file:///X|/, where X is a valid drive letter')
So as near as I can tell, file:///G:/push/bjt
should be correct, as should be file:///G|/push/bjt
The code in question is in bzrlib.urlutils.
In general, bzr should hide the fact that it is using file:/// urls from
the user. Obviously my changes broke the Config handling, and that needs
to be fixed (that is a different bug).
I probably just need to run the selftest on windows myself, and find
more of these problems.
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/20060609/a0fc5248/attachment.pgp
More information about the bazaar
mailing list