internal error string argument expaced got bytes

Bug #1913502 reported by Carl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
Triaged
High
Unassigned

Bug Description

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

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1022, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1208, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python3/dist-packages/breezy/commands.py", line 762, in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python3/dist-packages/breezy/commands.py", line 787, in run
return class_run(*args, **kwargs)
File "/usr/lib/python3/dist-packages/breezy/builtins.py", line 3768, in run
tree.commit(message_callback=get_message,
File "/usr/lib/python3/dist-packages/breezy/bzr/workingtree_4.py", line 245, in commit
result = WorkingTree.commit(self, message, revprops, *args,
File "/usr/lib/python3/dist-packages/breezy/mutabletree.py", line 172, in commit
committed_id = commit.Commit().commit(working_tree=self,
File "/usr/lib/python3/dist-packages/breezy/commit.py", line 446, in commit
self._process_post_hooks(old_revno, new_revno)
File "/usr/lib/python3/dist-packages/breezy/commit.py", line 612, in _process_post_hooks
self._process_hooks("post_commit", old_revno, new_revno)
File "/usr/lib/python3/dist-packages/breezy/commit.py", 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/__init__.py", line 83, in branch_commit_hook
emailer.EmailSender(master, new_revid, master.get_config_stack(),
File "/usr/lib/python3/dist-packages/breezy/plugins/email/emailer.py", line 266, in send_maybe
self.send()
File "/usr/lib/python3/dist-packages/breezy/plugins/email/emailer.py", line 210, in send
self._send_using_process()
File "/usr/lib/python3/dist-packages/breezy/plugins/email/emailer.py", line 218, in _send_using_process
diff = self.get_diff()
File "/usr/lib/python3/dist-packages/breezy/plugins/email/emailer.py", line 143, in get_diff
show_diff_trees(tree_old, tree_new, diff_content, None, diff_options)
File "/usr/lib/python3/dist-packages/breezy/diff.py", line 533, in show_diff_trees
return differ.show_diff(specific_files, extra_trees)
File "/usr/lib/python3/dist-packages/breezy/diff.py", line 1025, in show_diff
return self._show_diff(specific_files, extra_trees)
File "/usr/lib/python3/dist-packages/breezy/diff.py", 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],
zsh_completion[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
https://bugs.launchpad.net/brz/+filebug
including this traceback and a description of the problem.
make: *** [../../../gar/gar.mk:370: 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 :

self.to_file.write(b"==
actually it should pass in str, not bytes, self.to_file.write("==
no b
This appears in a few places in diff.py. 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.