install (current) Pillow
pip install pillow (comment: Pillow 10.x was installed) python3 captcha.py --font=/usr/share/fonts/truetype/freefont/FreeSansBold.ttf --wordlist=/usr/share/dict/words --key=wikiFOO --output=../../resources/assets/captcha --count=100 Generating 100 CAPTCHA images separated in 100 image(s) per chunk run by 1 threads... multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/var/www/vhosts/compusofia.com/httpdocs/w/extensions/ConfirmEdit/captcha.py", line 218, in run_in_thread gen_captcha(word, font, fontsize, os.path.join(output, filename)) File "/var/www/vhosts/compusofia.com/httpdocs/w/extensions/ConfirmEdit/captcha.py", line 84, in gen_captcha dim = font.getsize(text) AttributeError: 'FreeTypeFont' object has no attribute 'getsize' """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/var/www/vhosts/compusofia.com/httpdocs/w/extensions/ConfirmEdit/captcha.py", line 301, in <module> p.map(run_in_thread, data) File "/usr/lib/python3.10/multiprocessing/pool.py", line 367, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get raise self._value AttributeError: 'FreeTypeFont' object has no attribute 'getsize'
outcome: no captchas created
install Pillow 9.5.0
pip uninstall Pillow pip install Pillow==9.5.0 python3 captcha.py --font=/usr/share/fonts/truetype/freefont/FreeSansBold.ttf --wordlist=/usr/share/dict/words --key=wikiFOO --output=../../resources/assets/captcha --count=100 Generating 100 CAPTCHA images separated in 100 image(s) per chunk run by 1 threads... /var/www/vhosts/compusofia.com/httpdocs/w/extensions/ConfirmEdit/captcha.py:84:** DeprecationWarning: getsize is deprecated and will be removed in Pillow 10** (2023-07-01). Use getbbox or getlength instead. dim = font.getsize(text)
outcome: captchas successfully created
Software version
Mediawiki 1.4.1 - ConfirmEdit from .gz file
Other information
Ubuntu 22.04.3 LTS, python3.10, Pillow 10.x.x, Pillow 9.5.0