~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/urlutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-11 01:20:53 UTC
  • mfrom: (1711.2.40 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060611012053-5eb565dce8194ae0
(jam, alexander belchenko) Encoding fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
320
320
 
321
321
    if sys.platform == 'win32' and url.startswith('file:///'):
322
322
        # Strip off the drive letter
323
 
        if path[2:3] not in '\\/':
 
323
        # path is currently /C:/foo
 
324
        if path[2:3] not in ':|' or path[3:4] not in '\\/':
324
325
            raise errors.InvalidURL(url, 
325
326
                'win32 file:/// paths need a drive letter')
326
 
        url_base += path[1:4] # file:///C|/
327
 
        path = path[3:]
 
327
        url_base += path[0:3] # file:// + /C:
 
328
        path = path[3:] # /foo
328
329
 
329
330
    if exclude_trailing_slash and len(path) > 1 and path.endswith('/'):
330
331
        path = path[:-1]
435
436
    :return: A unicode string which can be safely encoded into the 
436
437
         specified encoding.
437
438
    """
 
439
    assert encoding is not None, 'you cannot specify None for the display encoding.'
438
440
    if url.startswith('file://'):
439
441
        try:
440
442
            path = local_path_from_url(url)