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

    From Bo YU@21:1/5 to All on Wed Oct 5 11:50:01 2022
    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
    ```
    The problem may be in importlib_metadata here, but I am not sure how to fix it. I remembered I do `python setup.py build/install` something ago.
    Any help is welcome!

    BR,
    Bo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bo YU@21:1/5 to Felix Yan on Wed Oct 5 13:10:01 2022
    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-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

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [30 lines of output]
    Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-c2wygkxs/sphinxcontrib-ditaa_10e1c64028af47e59b8fc5bf20b6901c/setup.py", line 8, in <module>
    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 = 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='distutils.setup_keywords'):
    File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
    return SelectableGroups.load(eps).select(**params)
    File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 459, in load
    ordered = sorted(eps, key=by_group)
    File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
    eps = itertools.chain.from_iterable(
    File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
    k = key(element)
    File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
    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.

    ```

    So I think the issue maybe not raised from sphinx extension, but it could be worse than that.

    Thanks for help:)
    [0]: https://pypi.org/project/sphinxcontrib-ditaa/

    --
    Regards,
    Felix Yan





    --
    Regards,
    --
    Bo YU


    -----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-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Felix Yan@21:1/5 to Bo YU on Wed Oct 5 12:50:01 2022
    To: debian-python@lists.debian.org (debian-python)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------4dVc2qlCMey66hBMrorm29Mn
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    T24gMTAvNS8yMiAxMjo0NywgQm8gWVUgd3JvdGU6DQo+IGhpLA0KPiAobWF5YmUgdGhpcyBp cyBvZmYgdG9waWMgb24gdGhpcyBsaXN0KQ0KPiBXaGVuIEkgd2FudCB0byBydW4gc3BoaW54 IGNtZCBvbiBteSBwYywgSSBnb3QgdGhlIGVycm9yOg0KPiBgYGANCj4gdmltZXJAZGV2On4v YnVpbGQvcmZzL3BhY2thZ2VzL3Rlc3RfZGlyJCBjYXQgL3RtcC9zcGhpbngtZXJyLWV0Z2Jv OXRnLmxvZw0KPiAjIFNwaGlueCB2ZXJzaW9uOiA0LjUuMA0KPiAjIFB5dGhvbiB2ZXJzaW9u OiAzL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DYyOCwgaW4gX25vcm1hbGl6ZWRfbmFtZQ0K PiAgICAgIHJldHVybiBQcmVwYXJlZC5ub3JtYWxpemUoc2VsZi5uYW1lKQ0KPiAgICBGaWxl ICIvdXNyL2xpYi9weXRob24zL2Rpc3QtcGFja2FnZXMvaW1wb3J0bGliX21ldGFkYXRhL19f aW5pdF9fLnB5IiwNCj4gbGluZSA4ODMsIGluIG5vcm1hbGl6ZQ0KPiAgICAgIHJldHVybiBy ZS5zdWIociJbLV8uXSsiLCAiLSIsIG5hbWUpLmxvd2VyKCkucmVwbGFjZSgnLScsICdfJykN Cj4gICAgRmlsZSAiL3Vzci9saWIvcHl0aG9uMy4xMC9yZS5weSIsIGxpbmUgMjA5LCBpbiBz dWINCj4gICAgICByZXR1cm4gX2NvbXBpbGUocGF0dGVybiwgZmxhZ3MpLnN1YihyZXBsLCBz dHJpbmcsIGNvdW50KQ0KPiBUeXBlRXJyb3I6IGV4cGVjdGVkIHN0cmluZyBvciBieXRlcy1s aWtlIG9iamVjdA0KPiBgYGANCg0KTG9va3MgbGlrZSB0aGlzOiBodHRwczovL2dpdGh1Yi5j b20vc3BoaW54LWRvYy9zcGhpbngvaXNzdWVzLzEwMzM5DQoNCkFyZSB5b3UgdXNpbmcgdGhl IHJpbm9odHlwZSBleHRlbnNpb24gdG9vPw0KDQotLSANClJlZ2FyZHMsDQpGZWxpeCBZYW4N
    Cg0K

    --------------4dVc2qlCMey66hBMrorm29Mn--

    -----BEGIN PGP SIGNATURE-----

    wsF5BAABCAAjFiEEtZcfLFwQqaCMYAMPeGxj8zDXy5IFAmM9XZEFAwAAAAAACgkQeGxj8zDXy5IA IQ//XARi2LGEzXJebv/rF5Hae6TxTjX3vmUwzHIyuBeN/TR9zZyHouBFMwf1kA9w4su/eoLwPTHd DMMQMmQH3GIqitFoOKBNSMHTX1mZ2rsDptdaIuuExl8+7VHaOmTkGTfNdbGHobiFw6QBuw07gRlW KZ7/dOS6OSXHQqViE2VhQ9qdTNWmQnoR901PslKL8pVa4U8DQYz+X4KsIMhYpr7tzSUcdeJHI0Ik 7AMY62lIZL/+jYK/rut4mtsrVJM4I0Hz1Im2CzLj8aW3/mxIj+wwCx7ir9zs1wzV7ovsb2lWtCVI 9EuEGNh1wGjpQJfkbYvo+oZ8pG00VHEWGZbgTGKhuQcaz6MPTKRooVDmRPj93iTCY+ys+Nc6OvD+ zH7U8+M9Z3/rxNREXRadNvZ7hNp1xZKTfVYVWDolzaatBsM3BVT78mPW5L1tF1HP2+IVAIn7+qL4 jF0ZXKwVAnGdNVCgiN+4WYCLUey8Fe9jxUCW8pZMjMkUy8ejFAfGbtc4kvDPvtqdMez9DerOdaLG OEZCH6FtXd4FsR8SXai+cUhYnCg+cEFbYfZdC3KjH84WLtJXXNhnGlSelSOhFyWmzj8SK45qCMNN PuEE1NfquvU3LBnfKlfSARm0lbFWtXZzwsrgZaAU5eW4elmOwWOP8SfYDhB37p9v1eqwC6nlSCJl ts8=
    =W7vt
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Felix Yan@21:1/5 to Bo YU on Wed Oct 5 13:30:02 2022
    Copy: debian-python@lists.debian.org (debian-python)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------L4rmsvFrQd80pbMG0kp5Wy3z
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    T24gMTAvNS8yMiAxNDowMiwgQm8gWVUgd3JvdGU6DQo+IGBgYA0KPiB2aW1lckBkZXY6fi9i dWlsZC9yZnMvcGFja2FnZXMvdGVzdF9kaXIkIHN1ZG8gcGlwMyBpbnN0YWxsICANCj4gc3Bo aW54Y29udHJpYi1kaXRhYQ0KPiBDb2xsZWN0aW5nIHNwaGlueGNvbnRyaWItZGl0YWENCj4g IMKgIFVzaW5nIGNhY2hlZCBzcGhpbnhjb250cmliLWRpdGFhLTEuMC4xLnRhci5neiAoNy41 IGtCKQ0KPiAgwqAgUHJlcG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8zSvIq3ZZoZ8bSsGfYG639hOmPQsZ1bFpao81CKBCzCIDhxNXnhYsKgPtW uUo=
    =BfGj
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bo YU@21:1/5 to Felix Yan on Thu Oct 6 03:50:02 2022
    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


    -----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-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)