这个错误“brz:错误:TypeError:需要一个类似字节的对象,而不是‘str’”是什么?

这个错误“brz:错误:TypeError:需要一个类似字节的对象,而不是‘str’”是什么?

我正在关注这个教程:https://packaging.ubuntu.com/html/packaging-new-software.html创建一个 ubuntu 包。说到bzr dh-make hello 2.10 hello-2.10.tar.gz我把它翻译成我自己的程序(pushpop),所以这里是命令行和结果:

$ 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.

你知道发生了什么吗?我该如何解决?

相关内容