[Python-modules-team] Bug#958669: "TypeError: can't concat str to bytes" in FileModifyCommand

Colin Watson cjwatson at debian.org
Fri Apr 24 11:34:47 BST 2020


Package: python3-fastimport
Version: 0.9.8-2
Severity: important

I tried to run "bzr fast-export" in lp:launchpad-buildd, and got the
following traceback:

11:31:38 Calculating the revisions to include ...
11:31:38 Starting export of 801 revisions ...
brz: ERROR: TypeError: can't concat str to bytes

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/plugins/fastimport/cmds.py", line 507, in run
    return exporter.run()
  File "/usr/lib/python3/dist-packages/breezy/plugins/fastimport/exporter.py", line 253, in run
    self.emit_commit(revid, self.ref)
  File "/usr/lib/python3/dist-packages/breezy/plugins/fastimport/exporter.py", line 372, in emit_commit
    self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
  File "/usr/lib/python3/dist-packages/breezy/plugins/fastimport/exporter.py", line 299, in print_cmd
    self.outf.write(b"%s\n" % cmd)
  File "/usr/lib/python3/dist-packages/fastimport/commands.py", line 189, in __bytes__
    return self.to_string(include_file_contents=True)
  File "/usr/lib/python3/dist-packages/fastimport/commands.py", line 241, in to_string
    filecommands = b''.join([b'\n' + repr_bytes(c)
  File "/usr/lib/python3/dist-packages/fastimport/commands.py", line 241, in <listcomp>
    filecommands = b''.join([b'\n' + repr_bytes(c)
  File "/usr/lib/python3/dist-packages/fastimport/helpers.py", line 120, in repr_bytes
    return bytes(obj)
  File "/usr/lib/python3/dist-packages/fastimport/commands.py", line 367, in __bytes__
    return self.to_string(include_file_contents=True)
  File "/usr/lib/python3/dist-packages/fastimport/commands.py", line 393, in to_string
    datastr = ('\ndata %d\n' % len(self.data)).encode('ascii') + self.data
TypeError: can't concat str to bytes

brz 3.0.2 on python 3.8.2 (Linux-5.4.0-21-generic-x86_64-with-glibc2.29)
arguments: ['/usr/bin/bzr', 'fast-export', '--export-marks=../git/marks']
plugins: bash_completion[3.0.2], changelog_merge[3.0.2],
    commitfromnews[3.0.2], cvs[3.0.2], darcs[3.0.2], debian[3.0.0],
    email[3.0.2], fastimport[3.0.2], launchpad[3.0.2], mtn[3.0.2],
    netrc_credential_store[3.0.2], news_merge[3.0.2], po_merge[3.0.2],
    propose[3.0.2], stats[3.0.2], upload[3.0.2], weave_fmt[3.0.2]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_GB.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.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.4.0-21-generic (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: unable to detect

Versions of packages python3-fastimport depends on:
ii  python3  3.8.2-3

python3-fastimport recommends no packages.

Versions of packages python3-fastimport suggests:
ii  git [git-core]  1:2.26.2-1

-- no debconf information

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the Python-modules-team mailing list