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


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

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

From Bo YU <tsu.yubo@gmail.com>
Newsgroups linux.debian.maint.python
Subject Re: how to fix TypeError: expected string or bytes-like object ?
Date 2022-10-06 03:50 +0200
Message-ID <Fdobo-ckrL-1@gated-at.bofh.it> (permalink)
References <Fd9cl-cbqD-1@gated-at.bofh.it> <Fda8p-cbZB-3@gated-at.bofh.it> <FdarL-cclL-5@gated-at.bofh.it> <FdaL8-ccsd-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,
On Wed, Oct 05, 2022 at 02:28:56PM +0300, Felix Yan wrote:
>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'))"
>

Great! It works.

I deleted the package that was installed by setup.py with above command
hint. Everythng is well now.

Many thanks~

-- 
Regards,
--
   Bo YU

Back to linux.debian.maint.python | Previous | Next — Previous 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