TypeError using brz in non-brz git repository

Bug #1799224 reported by Brian de Alwis
This bug report is a duplicate of:  Bug #1795681: TypeError in git repository. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
New
Undecided
Unassigned

Bug Description

Similar problem to https://bugs.launchpad.net/brz/+bug/1795681

/opt/pkg/bin/brz info
brz: ERROR: TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Traceback (most recent call last):
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1009, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1194, in run_bzr
    ret = run(*run_argv)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 760, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1211, in ignore_pipe
    result = func(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/builtins.py", line 1844, in run
    verbose=noise_level, outfile=self.outf)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/info.py", line 354, in show_bzrdir_info
    recommend_upgrade=False)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/dir.py", line 593, in open_workingtree
    return GitWorkingTree(self, repo, branch)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/workingtree.py", line 122, in __init__
    self._reset_data()
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/workingtree.py", line 677, in _reset_data
    self.store.__getitem__, self.store[head].tree)
  File "/opt/pkg/lib/python3.7/site-packages/dulwich/object_store.py", line 119, in __getitem__
    type_num, uncomp = self.get_raw(sha)
  File "/opt/pkg/lib/python3.7/site-packages/dulwich/object_store.py", line 446, in get_raw
    for pack in self.packs:
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 594, in packs
    self._update_pack_cache()
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 598, in _update_pack_cache
    for pack in self._load_packs():
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 625, in _load_packs
    if name.startswith("pack-") and name.endswith(".pack"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

brz 3.0a1 on python 3.7.0 (Darwin-17.7.0-x86_64-i386-64bit)
arguments: ['/opt/pkg/bin/brz', 'info']
plugins: bash_completion[3.0a1], changelog_merge[3.0a1],
    commitfromnews[unknown], cvs[3.0a1], darcs[unknown], email[unknown],
    fastimport[unknown], grep[3.0a1], launchpad[3.0a1], mtn[3.0a1],
    netrc_credential_store[3.0a1], news_merge[3.0a1], po_merge[3.0a1],
    repodebug[unknown], stats[3.0a1], upload[3.0a1], weave_fmt[3.0a1]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_CA.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/brz/+filebug
    including this traceback and a description of the problem.

Revision history for this message
Brian de Alwis (slyguy) wrote :
Download full text (3.7 KiB)

I should mention: I was trying `brz` in a git repository checked out from git. Fixing the above produces a new bug:

brz info
brz: ERROR: TypeError: a bytes-like object is required, not 'str'

Traceback (most recent call last):
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1009, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1194, in run_bzr
    ret = run(*run_argv)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 760, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/commands.py", line 1211, in ignore_pipe
    result = func(*args, **kwargs)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/builtins.py", line 1844, in run
    verbose=noise_level, outfile=self.outf)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/info.py", line 354, in show_bzrdir_info
    recommend_upgrade=False)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/dir.py", line 593, in open_workingtree
    return GitWorkingTree(self, repo, branch)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/workingtree.py", line 122, in __init__
    self._reset_data()
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/workingtree.py", line 677, in _reset_data
    self.store.__getitem__, self.store[head].tree)
  File "/opt/pkg/lib/python3.7/site-packages/dulwich/object_store.py", line 119, in __getitem__
    type_num, uncomp = self.get_raw(sha)
  File "/opt/pkg/lib/python3.7/site-packages/dulwich/object_store.py", line 446, in get_raw
    for pack in self.packs:
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 594, in packs
    self._update_pack_cache()
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 598, in _update_pack_cache
    for pack in self._load_packs():
  File "/opt/pkg/lib/python3.7/site-packages/breezy/git/transportgit.py", line 627, in _load_packs
    size = self.pack_transport.stat(name).st_size
  File "/opt/pkg/lib/python3.7/site-packages/breezy/transport/local.py", line 484, in stat
    path = self._abspath(relpath)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/transport/local.py", line 99, in _abspath
    return self._local_base + urlutils.unescape(relative_reference)
  File "/opt/pkg/lib/python3.7/site-packages/breezy/urlutils.py", line 684, in unescape
    return urlparse.unquote(url)
  File "/opt/pkg/lib/python3.7/urllib/parse.py", line 609, in unquote
    if '%' not in string:
TypeError: a bytes-like object is required, not 'str'

brz 3.0a1 on python 3.7.0 (Darwin-17.7.0-x86_64-i386-64bit)
arguments: ['/opt/pkg/bin/brz', 'info']
plugins: bash_completion[3.0a1], changelog_merge[3.0a1],
    ...

Read more...

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

These issues should be fixed in trunk.

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.