bzr fast-export TypeError: cannot concatenate 'str' and 'int' objects

Bug #1607974 reported by Bob Tanner on 2016-07-29
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Undecided
Bazaar Developers

Bug Description

$ bzr --version
Bazaar (bzr) 2.8.0dev1
  from bzr checkout /Users/tanner/projects/bzr.dev
    revision: 6619
    revid: <email address hidden>
    branch nick: bzr.dev
  Python interpreter: /Users/tanner/projects/ansible.git/bin/python 2.7.10
  Python standard library: /Users/tanner/projects/ansible.git/lib/python2.7
  Platform: Darwin-15.6.0-x86_64-i386-64bit
  bzrlib: /Users/tanner/projects/bzr.dev/bzrlib
  Bazaar configuration: /Users/tanner/.bazaar
  Bazaar log file: /Users/tanner/.bzr.log

$ bzr fast-export --plain .
17:17:35 Calculating the revisions to include ...
17:17:35 Starting export of 62 revisions ...
bzr: ERROR: exceptions.TypeError: cannot concatenate 'str' and 'int' objects

Traceback (most recent call last):
  File "/Users/tanner/projects/bzr.dev/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Users/tanner/projects/bzr.dev/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/Users/tanner/projects/bzr.dev/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Users/tanner/projects/bzr.dev/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Users/tanner/projects/bzr.dev/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Users/tanner/projects/bzr.dev/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Users/tanner/.bazaar/plugins/fastimport/cmds.py", line 720, in run
    return exporter.run()
  File "/Users/tanner/.bazaar/plugins/fastimport/exporter.py", line 240, in run
    self.emit_commit(revid, self.ref)
  File "/Users/tanner/.bazaar/plugins/fastimport/exporter.py", line 358, in emit_commit
    self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
  File "/Users/tanner/.bazaar/plugins/fastimport/exporter.py", line 441, in _get_commit_command
    more_authors=more_author_info, properties=properties)
  File "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/fastimport/commands.py", line 168, in __init__
    self.id = b':' + mark
TypeError: cannot concatenate 'str' and 'int' objects

bzr 2.8.0dev1 on python 2.7.10 (Darwin-15.6.0-x86_64-i386-64bit)
arguments: ['/Users/tanner/bin/bzr', 'fast-export', '--plain', '.']
plugins: bash_completion[2.8.0dev1], bzrtools[2.6.0],
    changelog_merge[2.8.0dev1], cvsps[unknown], email[unknown],
    explorer[1.3.0dev], fastimport[0.14.0dev], grep[2.8.0dev1],
    launchpad[2.8.0dev1], netrc_credential_store[2.8.0dev1],
    news_merge[2.8.0dev1], po_merge[2.8.0dev1], pqm[1.4.0dev],
    weave_fmt[2.8.0dev1]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_US.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/bzr/+filebug
    including this traceback and a description of the problem.

Related branches

Vincent Ladeuil (vila) on 2016-08-01
affects: bzr → bzr-fastimport
Benjamin Kaehne (ben-kaehne) wrote :

I am also experiencing this:

17:00:11 Calculating the revisions to include ...
17:00:11 Starting export of 261 revisions ...
bzr: ERROR: exceptions.TypeError: cannot concatenate 'str' and 'int' objects

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/ben/.bazaar/plugins/fastimport/cmds.py", line 720, in run
    return exporter.run()
  File "/home/ben/.bazaar/plugins/fastimport/exporter.py", line 240, in run
    self.emit_commit(revid, self.ref)
  File "/home/ben/.bazaar/plugins/fastimport/exporter.py", line 358, in emit_commit
    self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
  File "/home/ben/.bazaar/plugins/fastimport/exporter.py", line 441, in _get_commit_command
    more_authors=more_author_info, properties=properties)
  File "/home/ben/.local/lib/python2.7/site-packages/fastimport/commands.py", line 168, in __init__
    self.id = b':' + mark
TypeError: cannot concatenate 'str' and 'int' objects

bzr 2.7.0 on python 2.7.11 (Linux-4.4.0-21-generic-x86_64-with-
    Ubuntu-16.04-xenial)
arguments: ['/usr/bin/bzr', 'fast-export', '--export-marks=../marks.bzr', '.']
plugins: bash_completion[2.7.0], changelog_merge[2.7.0],
    fastimport[0.14.0dev], grep[2.7.0], launchpad[2.7.0],
    netrc_credential_store[2.7.0], news_merge[2.7.0], po_merge[2.7.0],
    weave_fmt[2.7.0]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'en_AU.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/bzr/+filebug
    including this traceback and a description of the problem.

tags: added: canonical-bootstack
javier García (biocratos) wrote :

This affects me too, but only when installing Fastimport with pip. If I install using apt, it works as expected.

rajan (vrajanap) wrote :

Yea, this affects me as well. With the following patch, I was able to work around the problem. I am unfamiliar with bzr - so couldn't open a PR right away.

=== modified file 'exporter.py'
--- exporter.py 2014-05-15 09:26:03 +0000
+++ exporter.py 2017-03-26 21:53:19 +0000
@@ -319,7 +319,7 @@
         mark = 1
         self.revid_to_mark[revid] = mark
         file_cmds = self._get_filecommands(bzrlib.revision.NULL_REVISION, revid)
- self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
+ self.print_cmd(self._get_commit_command(ref, str(mark), revobj, file_cmds))

     def emit_commit(self, revid, ref):
         if revid in self.revid_to_mark or revid in self.excluded_revisions:
@@ -355,7 +355,7 @@
         mark = ncommits + 1
         self.revid_to_mark[revid] = mark
         file_cmds = self._get_filecommands(parent, revid)
- self.print_cmd(self._get_commit_command(ref, mark, revobj, file_cmds))
+ self.print_cmd(self._get_commit_command(ref, str(mark), revobj, file_cmds))

         # Report progress and checkpoint if it's time for that
         self.report_progress(ncommits)

Pierre Equoy (pieq) wrote :

Same issue here. (Ubuntu 17.10, latest version of the fastimport bazaar plugin from `bzr branch lp:bzr-fastimport fastimport`)

Thanks Rajan for the patch, it works for me!

Changed in bzr-fastimport:
status: New → Confirmed
assignee: nobody → William Grant (wgrant)
assignee: William Grant (wgrant) → Bazaar Developers (bzr)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers