Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #14515

how to fix TypeError: expected string or bytes-like object ?

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Bo YU <tsu.yubo@gmail.com>
Newsgroups linux.debian.maint.python
Subject how to fix TypeError: expected string or bytes-like object ?
Date Wed, 05 Oct 2022 11:50:01 +0200
Message-ID <Fd9cl-cbqD-1@gated-at.bofh.it> (permalink)
X-Mailbox-Line From debian-python-request@lists.debian.org Wed Oct 5 09:48:22 2022
Old-Return-Path <tsu.yubo@gmail.com>
X-Amavis-Spam-Status No, score=-7.199 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, LDO_WHITELIST=-5, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -5.5
X-Gm-Message-State ACrzQf2UW49Yiu+Vnb3p8L5ZhQlRnC2Nu/1EdxdR70r6Hl63/1aZTAo+ 8OO5lhAVQeKJM3V9pE4VeexZ55jPKMYptcShOEi37RcJg10PXQ==
X-Google-SMTP-Source AMsMyM5pP0d9L9GuZ80WAuJ+oh0WV40fYDVaRWBOrR5X2THk4tECKR1fCZF74MxxARFAd8OY+wOSE4Eu3UfmhO2+mDI=
X-Received by 2002:a05:6512:6d4:b0:4a2:f89:db7d with SMTP id u20-20020a05651206d400b004a20f89db7dmr8615927lff.125.1664963284293; Wed, 05 Oct 2022 02:48:04 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Mailing-List <debian-python@lists.debian.org> archive/latest/20364
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/CAKq8=3LoQ6uAV6kWNiVu49kAk3wrsHuzVMNJ2je2bS0twxKvWA@mail.gmail.com
Approved robomod@news.nic.it
Lines 56
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Wed, 5 Oct 2022 17:47:52 +0800
X-Original-Message-ID <CAKq8=3LoQ6uAV6kWNiVu49kAk3wrsHuzVMNJ2je2bS0twxKvWA@mail.gmail.com>
Xref csiph.com linux.debian.maint.python:14515

Show key headers only | View raw


hi,
(maybe this is off topic on this list)
When I want to run sphinx cmd on my pc, I got the error:
```
vimer@dev:~/build/rfs/packages/test_dir$ cat /tmp/sphinx-err-etgbo9tg.log
# Sphinx version: 4.5.0
# Python version: 3.10.7 (CPython)
# Docutils version: 0.17.1 release
# Jinja2 version: 3.0.3
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 272,
in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line
220, in __init__
    self.preload_builder(buildername)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line
297, in preload_builder
    self.registry.preload_builder(self, name)
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 142,
in preload_builder
    builder_entry_points = entry_points(group='sphinx.builders')
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 1047, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 477, in load
    ordered = sorted(eps, key=by_group)
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 1044, in <genexpr>
    eps = itertools.chain.from_iterable(
  File "/usr/lib/python3/dist-packages/importlib_metadata/_itertools.py",
line 16, in unique_everseen
    k = key(element)
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 961, in _normalized_name
    or super()._normalized_name
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 628, in _normalized_name
    return Prepared.normalize(self.name)
  File "/usr/lib/python3/dist-packages/importlib_metadata/__init__.py",
line 883, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/usr/lib/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
```
The problem may be in importlib_metadata here, but I am not sure how to fix it.
I remembered I do `python setup.py build/install` something ago.
Any help is welcome!

BR,
Bo

Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

how to fix TypeError: expected string or bytes-like object ? Bo YU <tsu.yubo@gmail.com> - 2022-10-05 11:50 +0200
  Re: how to fix TypeError: expected string or bytes-like object ? Felix Yan <felixonmars@archlinux.org> - 2022-10-05 12:50 +0200
    Re: how to fix TypeError: expected string or bytes-like object ? Bo YU <tsu.yubo@gmail.com> - 2022-10-05 13:10 +0200
      Re: how to fix TypeError: expected string or bytes-like object ? Felix Yan <felixonmars@archlinux.org> - 2022-10-05 13:30 +0200
        Re: how to fix TypeError: expected string or bytes-like object ? Bo YU <tsu.yubo@gmail.com> - 2022-10-06 03:50 +0200

csiph-web