Directly affected are container-based deployments (they automatically install latest dependencies at container startup) and newly deployed baremetal deployments.
A workaround is to constraint Pillow<11 in requirements.txt. Proper fix would be through bumping the dependency and fixing the affected code.
Traceback
```py
Traceback (most recent call last):
File "/root/.local/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
ret = await coro(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pumpkin-py/modules/fun/fun/module.py", line 355, in bonk
frames[0].save(
File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2605, in save
save_handler(self, fp, filename)
File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 774, in _save_all
_save(im, fp, filename, save_all=True)
File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 787, in _save
if not save_all or not _write_multiple_frames(im, fp, palette):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 700, in _write_multiple_frames
background_im.putpalette(im_frames[0].im.palette)
File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2103, in putpalette
self.load() # install new palette
^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 909, in load
self.im.putpalette(self.palette.mode, mode, arr)
ValueError: invalid palette size
```
Pillow 11 has been released on 2024-10-15, and it broke gif generation for commands such as
bonk
orpet
.Directly affected are container-based deployments (they automatically install latest dependencies at container startup) and newly deployed baremetal deployments.
A workaround is to constraint
Pillow<11
inrequirements.txt
. Proper fix would be through bumping the dependency and fixing the affected code.Traceback
```py Traceback (most recent call last): File "/root/.local/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped ret = await coro(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/pumpkin-py/modules/fun/fun/module.py", line 355, in bonk frames[0].save( File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2605, in save save_handler(self, fp, filename) File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 774, in _save_all _save(im, fp, filename, save_all=True) File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 787, in _save if not save_all or not _write_multiple_frames(im, fp, palette): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/PIL/GifImagePlugin.py", line 700, in _write_multiple_frames background_im.putpalette(im_frames[0].im.palette) File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 2103, in putpalette self.load() # install new palette ^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/PIL/Image.py", line 909, in load self.im.putpalette(self.palette.mode, mode, arr) ValueError: invalid palette size ```