Skip to content

docutils: triggers PIL TypeError #9966

Closed as not planned
Closed as not planned

Description

@kiefernforst

Dear devs,

I'm getting a nasty Pillow error in 3bac017

My last build has been from February 2026 and did not contain this error:

  File "/usr/lib/python3.10/site-packages/docutils/writers/html4css1/__init__.py", line 23, in <module>
    from docutils.writers import _html_base
  File "/usr/lib/python3.10/site-packages/docutils/writers/_html_base.py", line 35, in <module>
    from docutils.parsers.rst.directives.images import PIL
  File "/usr/lib/python3.10/site-packages/docutils/parsers/rst/directives/images.py", line 14, in <module>
    import PIL.Image
  File "/usr/lib/python3.10/site-packages/PIL/Image.py", line 48, in <module>
    from . import (
  File "/usr/lib/python3.10/site-packages/PIL/TiffTags.py", line 462, in <module>
    _populate()
  File "/usr/lib/python3.10/site-packages/PIL/TiffTags.py", line 456, in _populate
    TAGS_V2[k] = TagInfo(k, *v)
  File "/usr/lib/python3.10/site-packages/PIL/TiffTags.py", line 47, in __new__
    return super().__new__(cls, value, name, type, length, enum or {})
TypeError: _TagInfo.__new__() takes 1 positional argument but 6 were given

the following commands don't run due to the TypeError on import:

python3 -m PIL.report
or
python3 -m PIL --report

from PIL import report

from PIL import features
features.pilinfo(supported_formats=False)

@hugovk May your typing db8e579 possible have broken it?

I've downgraded TiffTags.py to the last untyped version 43b2f61 to allow docutils to work again.

Activity

  1. radarhere commented on Sep 6, 2026

    @radarhere
    Member

    Hi. While I haven't checked anything specifically, db8e579 is part of #9750, entitled 'Drop support for Python 3.10'. Your log shows that you are using Python 3.10, so it doesn't seem surprising that you are receiving an error.

    We are preparing for the next release of Pillow in October. October is when Python 3.10 becomes EOL. Is there some reason you cannot update to Python 3.11 or newer?

  2. kiefernforst commented on Sep 7, 2026

    @kiefernforst
    Author

    @radarhere Hi Andrew,

    sorry for asking so bluntly: Is the type safety any better with typing.Self or this more a cosmetic change?

  3. radarhere commented on Sep 7, 2026

    @radarhere
    Member

    No problem.

    In the case of _TagInfo, I don't think it makes a difference, but if you scroll through 2f15eb1, you'll find that Self allowed us to remove two __enter__ methods, because using Self with that method in a parent class also works for the child class.

  4. radarhere commented on Sep 8, 2026

    @radarhere
    Member

    Do you have any further questions?

    I think the fundamental problem here is that you're using the absolute latest version of Pillow, the main branch ahead of what has been formally released, with an older version of Python that will be end of life soon. It's an odd pairing.

  5. github-actions commented on Sep 16, 2026

    @github-actions

    Closing this issue as no feedback has been received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions