PIL: ord() expected a character, but string of length 0 found (SOLVED)
Using Django, and easy_thumbnails coupled with Pillow specifically I’m stumbled upon this error in PIL.ImageFile on PIL/\_binary.py:
ord() expected a character, but string of length 0 found
This python error was so frequent I’ve done some research, coming up with nothing.
I’ve checked current Pillow version with:
pip freeze | grep Pillow
Getting:
Pillow==0
Then I’ve upgraded the Pillow package with this:
pip install Pillow --upgrade
The sofware was updated to the very last version (0) without any issue on easy_thumbnails backend or frontend.
Consequently, pip freeze returned:
Pillow==0
and errors are gone.
tl;dr: Update Pillow from 0 to latest version (0 by now)
Note: this error can be accompained by others:
- unpack requires a string argument of length 2
- string index out of range
Upgrading Pillow also correct these.
Response: 20 (Success), text/gemini
| Original URL | gemini://chirale.org/2018-02-27_4224.gmi |
|---|---|
| Status Code | 20 (Success) |
| Content-Type | text/gemini; charset=utf-8 |