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

Asked by Yves Baumes

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?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.