~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/urlutils.py

  • Committer: Jared Bunting
  • Date: 2010-10-21 22:27:43 UTC
  • mto: This revision was merged to the branch mainline in revision 5514.
  • Revision ID: jared.bunting@peachjean.com-20101021222743-tn9n0cgzg3z8cb25
Changed _win32_local_path_from_url to not allow "file:///C:" form.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        return '/'
225
225
 
226
226
    # usual local path with drive letter
227
 
    if (len(win32_url) < 5
 
227
    if (len(win32_url) < 6
228
228
        or win32_url[3] not in ('abcdefghijklmnopqrstuvwxyz'
229
229
                                'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
230
230
        or win32_url[4] not in  '|:'
231
 
        or (len(win32_url) > 5 and win32_url[5] != '/')):
 
231
        or win32_url[5] != '/'):
232
232
        raise errors.InvalidURL(url, 'Win32 file urls start with'
233
233
                ' file:///x:/, where x is a valid drive letter')
234
234
    return win32_url[3].upper() + u':' + unescape(win32_url[5:])