brz fast-export fails with TypeError: write() argument must be str, not bytes

Bug #1805172 reported by Balint Reczey on 2018-11-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
High
Jelmer Vernooij

Bug Description

Thank you for maintaining the Breezy!

I'm working on converting on many Bazaar repositories to Git and wanted to give a try to brz replacing bzr [1], but it failed quickly in brz fast-export:

root@cc-daily:~# brz fast-export lp:anna > /dev/null
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
16:03:43 Calculating the revisions to include ...
16:03:44 Starting export of 1491 revisions ...
brz: ERROR: TypeError: write() argument must be str, not 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 137, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  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 505, 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)
TypeError: write() argument must be str, not bytes

brz version: 3.0.0~bzr7192-0~bzr4354~ubuntu18.10.1

[1] https://code.launchpad.net/~ubuntu-core-dev/+git/bzr-git-mass-convert/+ref/use-brz

Related branches

On Mon, Nov 26, 2018 at 04:07:05PM -0000, Balint Reczey wrote:
> Public bug reported:
>
> Thank you for maintaining the Breezy!
>
> I'm working on converting on many Bazaar repositories to Git and wanted
> to give a try to brz replacing bzr [1], but it failed quickly in brz
> fast-export:
Thanks for the bug report. This should be a simple thing to fix. In
the mean time, you can specify /dev/stdout explicitly to work around
it:

$ brz fast-export lp:anna /dev/stdout

--
Jelmer Vernooij <email address hidden>
PGP Key: https://www.jelmer.uk/D729A457.asc

Jelmer Vernooij (jelmer) on 2018-11-26
Changed in brz:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 3.0.0
Jelmer Vernooij (jelmer) wrote :

If you're running bzr fast-export against a remote server, you may
also be interested in lp:~jelmer/brz/faster-fastexport

--
Jelmer Vernooij <email address hidden>
PGP Key: https://www.jelmer.uk/D729A457.asc

Jelmer Vernooij (jelmer) on 2019-01-02
Changed in brz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers