Path: csiph.com!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod From: Bo YU Newsgroups: linux.debian.maint.python Subject: Re: how to fix TypeError: expected string or bytes-like object ? Date: Thu, 06 Oct 2022 03:50:02 +0200 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Thu Oct 6 01:43:53 2022 Old-Return-Path: X-Amavis-Spam-Status: No, score=-10.699 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, BODY_8BITS=1.5, 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, PGPSIGNATURE=-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: ACrzQf1ls8asA5BJKpFvWGXEqm5t4dHKCHQPBSf7VrH1DoIxtwyYMntC AESe2rjumZ44P4ZIvmB4VuAhYS0VAkA= X-Google-SMTP-Source: AMsMyM6KWSM8QfIat4L6DnF/Y+I8kMggJriMLqNqM9G1dggK9LGxpNtG/vQ5vMqzDDLkxkskf6Bbkg== X-Received: by 2002:a17:902:e414:b0:17f:5c82:ac01 with SMTP id m20-20020a170902e41400b0017f5c82ac01mr2165595ple.123.1665020614723; Wed, 05 Oct 2022 18:43:34 -0700 (PDT) X-PGP-Key: https://github.com/yuzibo/yuzibo.github.io/blob/master/_includes/subkey-signing-06-18-143E4BAF-pub.asc MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g5oalxxmscmrfqqh" Content-Disposition: inline X-Mailing-List: archive/latest/20370 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/20221006014330.v4qhktvrcdej3b7q@debian Approved: robomod@news.nic.it Lines: 94 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-python X-Original-Date: Thu, 6 Oct 2022 09:43:30 +0800 X-Original-Message-ID: <20221006014330.v4qhktvrcdej3b7q@debian> X-Original-References: <20221005110221.5ctgsxgzp2vnk5ed@debian> Xref: csiph.com linux.debian.maint.python:14521 --g5oalxxmscmrfqqh Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =20 >>sphinxcontrib-ditaa >>Collecting sphinxcontrib-ditaa >> =C2=A0 Using cached sphinxcontrib-ditaa-1.0.1.tar.gz (7.5 kB) >> =C2=A0 Preparing metadata (setup.py) ... error >> =C2=A0 error: subprocess-exited-with-error >> [...] >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return self._name= _from_stem(stem) or super()._normalized_name >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 File "/usr/lib/python3.10/imp= ortlib/metadata/__init__.py",=20 >>line 622, in _normalized_name >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Prepared.n= ormalize(self.name) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 File "/usr/lib/python3.10/imp= ortlib/metadata/__init__.py",=20 >>line 871, in normalize >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return re.sub(r"[= -_.]+", "-", name).lower().replace('-', '_') >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 File "/usr/lib/python3.10/re.= py", line 209, in sub >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return _compile(p= attern, flags).sub(repl, string, count) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 TypeError: expected string or bytes-like = object >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [end of output] >> >> =C2=A0 note: This error originates from a subprocess, and is likely not= =20 >>a problem with pip. >>error: metadata-generation-failed >> >>=C3=97 Encountered error while generating package metadata. >>=E2=95=B0=E2=94=80> See above for output. >> >>``` > >You are right. The traceback is indeed different but more similar to=20 >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=20 >result to yours. > >The following command may help to locate the actual offending package: > >strace -eopenat python -c "from importlib.metadata import=20 >entry_points; print(entry_points(group=3D'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~ --=20 Regards, -- Bo YU --g5oalxxmscmrfqqh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcmhjYVTlmab0tjp+RVP3hQ+S68FAmM+MrwACgkQ+RVP3hQ+ S68eRw//YQpiyCItl4MGNVOsvUlEAUS6N0Vsqpdn9JO5VWQ77rVyc78tnpJOnwyx vrsZQxS1xzpAb51OBPM784XXCwCfYteKrhrI6iliJkhzapCGcTHtIKAAv5wq7FF/ PIcGTT4bxjoF3HL3vVi+nJ0UqpfqWCZrOrVI8BenB4YotD5BlMG4Z/OiyyFDPUr2 EkbguEGgcWwF6jF0WNgS3lvKKvfmkD5db6Hk8Y0evminqAx9u8b+aqqM31d81//i 4CC6kW3PfndSqv71HNk8d/0iwWYASeT6OBrJt2ZUUJeni88BIDBU/i0CnMS9D0N0 PGZgSpTSv2BKRX6Km+OtyUihct0o+q0CkpXO5Y/09vZYhCMfkEeJzdhKtaNLMWBX /ifbeAveQZ+LUxKiXao8hIIa4Fi1hubvQf1GKFAPAbWoXbjJAECN0qir4EhQipQ1 H7nhvgGDrCR+yNGnriDOc2hKYEiRBuzHzXAE+I7QWgD6hkah8YKaq7sIrwMVb7LU yT+rDD7Z31oo74JMDZvmfSv4K6FJXAk2h7IGsQ8oSfyYx+guCC8+fbXRxV45T770 f3HI9V0zharDwDxr7g6m7G3NE9dGQrKdQO4pVH3VmPJ8vqZ5+JJnKaIs+akwD+uW VLDk3aeU5ZKSackzFRHUh4G+WDlLMyMGqSDRb+jiRLHM1lomkTg= =NJwK -----END PGP SIGNATURE----- --g5oalxxmscmrfqqh--