Score:0

What is this error "brz: ERROR: TypeError: a bytes-like object is required, not 'str'"?

mx flag

I am following this tutorial: https://packaging.ubuntu.com/html/packaging-new-software.html to create an ubuntu package. When it comes to bzr dh-make hello 2.10 hello-2.10.tar.gz I translate it to my own program (pushpop), so here is the command line and the result:

$ bzr dh-make pushpop 0.0.1 pushpop-0.0.1.tar.gz 
Fetching tarball
Looking for a way to retrieve the upstream tarball
Upstream tarball already exists in build directory, using that
brz: ERROR: TypeError: a bytes-like object is required, not 'str'                                            

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/debian/cmds.py", line 1385, in run
    tree = dh_make.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 94, in import_upstream
    db.import_upstream_tarballs(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/import_dsc.py", line 910, in import_upstream_tarballs
    return self.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/import_dsc.py", line 881, in import_upstream
    (tag, revid) = self.pristine_upstream_source.import_component_tarball(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/upstream/pristinetar.py", line 444, in import_component_tarball
    tag_name = self.tag_name(version, component=component)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/upstream/pristinetar.py", line 321, in tag_name
    name = "upstream/" + version.replace('~', '_')
TypeError: a bytes-like object is required, not 'str'

You can report this problem to Bazaar's developers by running
    apport-bug /var/crash/brz.1000.2021-08-31T14:22.crash
if a bug-reporting window does not automatically appear.

Do you know what's happening? How can I sort it out?

user.dz avatar
ng flag
Could it be a python3 vs python2 compatibility issue? (for `bzr` script)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.