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:
```
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
On 10/5/22 14:02, Bo YU wrote:[...]
```
vimer@dev:~/build/rfs/packages/test_dir$ sudo pip3 install >>sphinxcontrib-ditaa
Collecting sphinxcontrib-ditaa
Using cached sphinxcontrib-ditaa-1.0.1.tar.gz (7.5 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
return self._name_from_stem(stem) or super()._normalized_name
File "/usr/lib/python3.10/importlib/metadata/__init__.py", >>line 622, in _normalized_name
return Prepared.normalize(self.name)
File "/usr/lib/python3.10/importlib/metadata/__init__.py", >>line 871, 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
[end of output]
note: This error originates from a subprocess, and is likely not
a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
```
You are right. The traceback is indeed different but more similar to
this one, probably: https://github.com/pypa/setuptools/issues/3273
I have tried to make an empty .dist-info dir and got the very similar
result to yours.
The following command may help to locate the actual offending package:
strace -eopenat python -c "from importlib.metadata import
entry_points; print(entry_points(group='sphinx.builders'))"
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 349 |
Nodes: | 16 (3 / 13) |
Uptime: | 106:44:06 |
Calls: | 7,612 |
Calls today: | 3 |
Files: | 12,786 |
Messages: | 5,682,993 |
Posted today: | 1 |