[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



On 10/5/22 12:47, Bo YU wrote:
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
```

Looks like this: https://github.com/sphinx-doc/sphinx/issues/10339

Are you using the rinohtype extension too?

--
Regards,
Felix Yan

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: