IndexError on windows from any operation that opens a transport at root drive

Bug #841322 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Martin Packman

Bug Description

Many basic bzr operations are broken on bzr.dev on windows, for instance doing a local branch:

Traceback (most recent call last):
  File "bzrlib\commands.py", line 918, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "bzrlib\commands.py", line 1118, in run_bzr
    ret = run(*run_argv)
  File "bzrlib\commands.py", line 676, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "bzrlib\commands.py", line 698, in run
    return self._operation.run_simple(*args, **kwargs)
  File "bzrlib\cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "bzrlib\cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "bzrlib\commands.py", line 1133, in ignore_pipe
    result = func(*args, **kwargs)
  File "bzrlib\builtins.py", line 1594, in run
    show_bzrdir_info(bzrdir.BzrDir.open_containing(location)[0],
  File "bzrlib\bzrdir.py", line 874, in open_containing
    transport = _mod_transport.get_transport(url, possible_transports)
  File "bzrlib\transport\__init__.py", line 1645, in get_transport
    return get_transport_from_url(location_to_url(base), possible_transports)
  File "bzrlib\transport\__init__.py", line 1620, in get_transport_from_url
    transport, last_err = _try_transport_factories(url, factory_list)
  File "bzrlib\transport\__init__.py", line 1652, in _try_transport_factories
    return factory.get_obj()(base), None
  File "bzrlib\transport\local.py", line 73, in __init__
    super(LocalTransport, self).__init__(base)
  File "bzrlib\transport\__init__.py", line 314, in __init__
    base.rstrip("/"))[1]
  File "bzrlib\urlutils.py", line 458, in split_segment_parameters
    (base_url, subsegments) = split_segment_parameters_raw(url)
  File "bzrlib\urlutils.py", line 445, in split_segment_parameters_raw
    (parent_url, child_dir) = split(url)
  File "bzrlib\urlutils.py", line 430, in split
    url_base, path = _win32_extract_drive_letter(url_base, path)
  File "bzrlib\urlutils.py", line 391, in _win32_extract_drive_letter
    if len(path) < 3 or path[2] not in ':|' or path[3] != '/':
IndexError: string index out of range

Was looking for problems in the bzr-git path handling code, but this isn't related to plugins.

Tags: windows

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

The index file *always* contains posix paths, even on Windows so just using bzrlib.osutils won't be sufficient. We'll need translations of paths.

Changed in bzr-git:
status: New → Triaged
importance: Undecided → Medium
summary: - Platform appropriate path handling needed
+ need conversion of paths for Index on Windows
tags: added: windows
Revision history for this message
Martin Packman (gz) wrote : Re: need conversion of paths for Index on Windows

Actually, this isn't bzr-git related, but seems to be a Bazaar 2.5 regression.

affects: bzr-git → bzr
Changed in bzr:
status: Triaged → New
description: updated
summary: - need conversion of paths for Index on Windows
+ IndexError branching from one windows dir to another
Revision history for this message
Martin Packman (gz) wrote : Re: IndexError branching from one windows dir to another

Regression from r6079 to do with the addressing of colocated branches, specifically the addition of split_segment_parameters_raw calls in urlutils.local_path_from_url implementations.

That no test caught such a fundamental breakage is pretty terrifying.

Revision history for this message
Martin Packman (gz) wrote :

Good news is that this did cause a lot of fallout on the windows buildbot at least:
<http://babune.ladeuil.net:24842/job/selftest-windows/503/>

The trivial error _win32_extract_drive_letter is easy enough to fix, however that doesn't get at the root problem which seems to be a design issue with the urlutils.split_segment_parameters functions. They are designed to remove the outside-of-url special comma syntax, but the first thing they do is try to split the url according to its rules, assuming it will ignore everything following the comma. This does not work if added suffix makes the url invalid.

Changed in bzr:
importance: Medium → Critical
status: New → Confirmed
description: updated
summary: - IndexError branching from one windows dir to another
+ IndexError on windows from any operation that opens a transport at root
+ drive
Revision history for this message
Martin Packman (gz) wrote :

Marking this issue as fixed, and filed bug 842223 and bug 842233 (yes, those are different) for the remaining fallout from r6079.

Changed in bzr:
assignee: nobody → Martin [gz] (gz)
status: Confirmed → Fix Released
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.5b1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.