Edgewall Software

Opened 9 years ago

Last modified 7 years ago

#12133 closed defect

Dependency not satisfied even if pillow installed — at Version 5

Reported by: Ryan J Ollos Owned by: Dirk Stöcker
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version:
Severity: normal Keywords:
Cc: Dirk Stöcker Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

In #11031 / [11730] the code was modified to support pillow in addition to pil. However, since [4181], the package PIL is required in setup.py. Installing Pillow doesn't seem to be sufficient to satisfy the dependency.

I don't see a simple way to specify Pillow or PIL in setup.py's extras_require. It might be easiest, since PIL doesn't seem to be maintained any longer, to just require Pillow.

# ./trac-hacks.org/pve/bin/python
Python 2.7.9 (default, Mar  1 2015, 12:57:24) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> pkg_resources.get_distribution('pillow').version
'2.9.0'

For now I just use the following in my install scripts:

sed -i -e 's/pil/pillow/g' $src/spam-filter/setup.py

Change History (5)

comment:1 by Ryan J Ollos, 9 years ago

Another consideration - when branching for Trac 1.2, support for Pillow < 2 can be dropped. See Pillow's supported python versions.

Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:2 by Ryan J Ollos, 9 years ago

Note to update SpamFilter#Requirements if requirements are changed to use Pillow.

comment:3 by Ryan J Ollos, 9 years ago

Milestone: plugin - spam-filter

comment:4 by Ryan J Ollos, 9 years ago

Found the following in the logs, possibly relevant:

2015-09-23 22:59:03,863 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/captcha/image'">, referrer 'https://trac-hacks.org/captcha'
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 554, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 247, in dispatch
    resp = chosen_handler.process_request(req)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/captcha/image.py", line 80, in process_request
    self.font_size)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/captcha/image.py", line 108, in gen_captcha
    font = ImageFont.truetype(fnt,fnt_sz)
  File "/usr/lib/python2.6/dist-packages/PIL/ImageFont.py", line 218, in truetype
    return FreeTypeFont(filename, size, index, encoding)
  File "/usr/lib/python2.6/dist-packages/PIL/ImageFont.py", line 134, in __init__
    self.font = core.getfont(file, size, index, encoding)
IOError: cannot open resource

comment:5 by Ryan J Ollos, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.