Path: csiph.com!news.mixmin.net!aioe.org!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: Wed, 05 Oct 2022 13:10:01 +0200 Message-ID: References: X-Original-To: Felix Yan X-Mailbox-Line: From debian-python-request@lists.debian.org Wed Oct 5 11:02:47 2022 Old-Return-Path: X-Amavis-Spam-Status: No, score=-12.199 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DIGITS_LETTERS=1, 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, MD5_SHA1_SUM=-1, 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: ACrzQf1EeZdcwjclFVNMCpLUuXB/vJUddrtgBIm5MUmJK/+bd/fabcIy jjQU9hZTBWmPsKRFjBqA1S5JuE7N+faLDw== X-Google-SMTP-Source: AMsMyM4mjkptfAfkAlaKehOorQs56LFE3ubkcaKCW1YbOEMBrVtEXefcLRsJ4+yYtfGD0bmjPvoBuA== X-Received: by 2002:a17:902:d506:b0:178:3599:5e12 with SMTP id b6-20020a170902d50600b0017835995e12mr31294006plg.70.1664967744867; Wed, 05 Oct 2022 04:02:24 -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="3xsnj27t4ltnxnxe" Content-Disposition: inline X-Mailing-List: archive/latest/20366 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/20221005110221.5ctgsxgzp2vnk5ed@debian Approved: robomod@news.nic.it Lines: 137 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-python X-Original-Date: Wed, 5 Oct 2022 19:02:21 +0800 X-Original-Message-ID: <20221005110221.5ctgsxgzp2vnk5ed@debian> X-Original-References: Xref: csiph.com linux.debian.maint.python:14517 --3xsnj27t4ltnxnxe Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Oct 05, 2022 at 01:33:53PM +0300, Felix Yan wrote: >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 I noticed it also but I did not remember use sphinx with rinohtype extension. > >Are you using the rinohtype extension too? The fact is that I am packaging the sphinxcontrib-ditaa[0] and I want to test it via pip3: ``` vimer@dev:~/build/rfs/packages/test_dir$ sudo pip3 install sphinxcontrib-d= itaa 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 =C3=97 python setup.py egg_info did not run successfully. =E2=94=82 exit code: 1 =E2=95=B0=E2=94=80> [30 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-c2wygkxs/sphinxcontrib-ditaa_10e1c64028af47= e59b8fc5bf20b6901c/setup.py", line 8, in setup( File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line= 86, in setup _install_setup_requires(attrs) File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line= 75, in _install_setup_requires dist =3D MinimalDistribution(attrs) File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line= 57, in __init__ super().__init__(filtered) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 474= , in __init__ for ep in metadata.entry_points(group=3D'distutils.setup_keyword= s'): File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 10= 09, in entry_points return SelectableGroups.load(eps).select(**params) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 45= 9, in load ordered =3D sorted(eps, key=3Dby_group) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 10= 06, in eps =3D itertools.chain.from_iterable( File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line = 16, in unique_everseen k =3D key(element) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 94= 1, in _normalized_name return self._name_from_stem(stem) or super()._normalized_name File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 62= 2, in _normalized_name return Prepared.normalize(self.name) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 87= 1, 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 probl= em with pip. error: metadata-generation-failed =C3=97 Encountered error while generating package metadata. =E2=95=B0=E2=94=80> See above for output. ``` So I think the issue maybe not raised from sphinx extension, but it could b= e worse than that. Thanks for help:) [0]: https://pypi.org/project/sphinxcontrib-ditaa/ > >--=20 >Regards, >Felix Yan > --=20 Regards, -- Bo YU --3xsnj27t4ltnxnxe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcmhjYVTlmab0tjp+RVP3hQ+S68FAmM9ZDgACgkQ+RVP3hQ+ S6+2wg//RTs8yaDep8pG5/PLSs4YAt3oXU7EiRY1hFmU8VwtLu+1b5LC7nEF4sk/ Ob1W542RDYzLbe4/2ISZ92QVwwTeSGTssuLp1VMDs9sd/YFkZjnB24o/wH/bvtfd bU0tOSqXOB7AqvFpxtfl1B+jUrsP6CLN+pWHbJP+SqCxrphH0fFvnkhIB4w1XfqV YGIJ5fGvP5LVaBXUO6p1Z7TPf/RiMGlq2b5Nz1aji1xZC/wEb4M8BPa7SNOZu5oO har4Pur7ycGULEtNyU7kdUobOTPgWyZAbjooJFZRcgKr9TIjfbInkbrirZBWTJzn M6wictYiuMJhtWBoqGH3OV0/dTRDprpf9DFEL6++/djTGvP9Z6IQsSbVCDnwqJ8/ ftla7+j7FzRsZv/fAYbAH3cJE7Lb1FIU96KHCmqgjPbn55ctFGDRCazwg2l74q88 r5/E2WwmddoX5nmMxxNza56OZ99ZgNyChZTa9RGLMu3c2np2Wgapx8Np/05il5jk SeJaGBTAzq2e6MImkhmwvGicFRWeDhELP2c2sdSwmVtnGL5YVUMVDkPHBXf0lp5h 84uXzK1dxIFL5upIsATSUqs9ov7fMBi6fzwSvkHA2gbyrPU8waOw/fY1gPWARjzW LV6o5u6Oov5aDP0Iz40QvJW1Ux7V3gzacsW+VVsN0qR/E4/Ya2I= =iXYO -----END PGP SIGNATURE----- --3xsnj27t4ltnxnxe--