internal error string argument expaced got bytes

Bug #1913502 reported by Carl
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

brz: ERROR: TypeError: string argument expected, got 'bytes'

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/breezy/", line 1022, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/usr/lib/python3/dist-packages/breezy/", line 1208, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python3/dist-packages/breezy/", line 762, in run_argv_aliases
File "/usr/lib/python3/dist-packages/breezy/", line 787, in run
return class_run(*args, **kwargs)
File "/usr/lib/python3/dist-packages/breezy/", line 3768, in run
File "/usr/lib/python3/dist-packages/breezy/bzr/", line 245, in commit
result = WorkingTree.commit(self, message, revprops, *args,
File "/usr/lib/python3/dist-packages/breezy/", line 172, in commit
committed_id = commit.Commit().commit(working_tree=self,
File "/usr/lib/python3/dist-packages/breezy/", line 446, in commit
self._process_post_hooks(old_revno, new_revno)
File "/usr/lib/python3/dist-packages/breezy/", line 612, in _process_post_hooks
self._process_hooks("post_commit", old_revno, new_revno)
File "/usr/lib/python3/dist-packages/breezy/", line 650, in _process_hooks
hook(hook_local, hook_master, old_revno, old_revid, new_revno,
File "/usr/lib/python3/dist-packages/breezy/plugins/email/", line 83, in branch_commit_hook
emailer.EmailSender(master, new_revid, master.get_config_stack(),
File "/usr/lib/python3/dist-packages/breezy/plugins/email/", line 266, in send_maybe
File "/usr/lib/python3/dist-packages/breezy/plugins/email/", line 210, in send
File "/usr/lib/python3/dist-packages/breezy/plugins/email/", line 218, in _send_using_process
diff = self.get_diff()
File "/usr/lib/python3/dist-packages/breezy/plugins/email/", line 143, in get_diff
show_diff_trees(tree_old, tree_new, diff_content, None, diff_options)
File "/usr/lib/python3/dist-packages/breezy/", line 533, in show_diff_trees
return differ.show_diff(specific_files, extra_trees)
File "/usr/lib/python3/dist-packages/breezy/", line 1025, in show_diff
return self._show_diff(specific_files, extra_trees)
File "/usr/lib/python3/dist-packages/breezy/", line 1090, in _show_diff
self.to_file.write(b"=== modified %s '%s'%s\n" % (kind[0].encode('ascii'),
TypeError: string argument expected, got 'bytes'

brz 3.1.0 on python 3.9.1 (Linux-5.10.0-1-amd64-x86_64-with-glibc2.31)
arguments: ['/usr/bin/bzr', 'commit', '.', '-m', 'update parted to 3.4']
plugins: bash_completion[3.1.0], changelog_merge[3.1.0],
commitfromnews[3.1.0], cvs[3.1.0], darcs[3.1.0], email[3.1.0],
fastimport[3.1.0], flake8[unknown], fossil[3.1.0], github[3.1.0],
gitlab[3.1.0], hg[3.1.0], launchpad[3.1.0], mtn[3.1.0],
netrc_credential_store[3.1.0], news_merge[3.1.0], po_merge[3.1.0],
propose[3.1.0], quilt[unknown], repodebug[3.1.0], rewrite[unknown],
stats[3.1.0], svn[3.1.0], upload[3.1.0], weave_fmt[3.1.0],
encoding: 'ascii', fsenc: 'utf-8', lang: 'C'

*** 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
including this traceback and a description of the problem.
make: *** [../../../gar/ ci] Error 4

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

This looks like a bug in brz-email - it should be passing in BytesIO but is passing in StringIO.

Changed in brz:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Carl (carlhansen1234) wrote :

actually it should pass in str, not bytes, self.to_file.write("==
no b
This appears in a few places in Many other places to_file.write appears without the.

Still something else not right

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

The problem is that brz-email passes in a StringIO() object rather than a BytesIO() object.

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.