Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12133 closed defect (fixed)

Dependency not satisfied even if pillow installed

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

Replaced PIL dependency with Pillow.

API 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

Attachments (1)

t12133.diff (1.6 KB ) - added by Ryan J Ollos 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Ryan J Ollos, 4 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 4 years ago by Ryan J Ollos (previous) (diff)

comment:2 by Ryan J Ollos, 4 years ago

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

comment:3 by Ryan J Ollos, 4 years ago

Milestone: plugin - spam-filter

comment:4 by Ryan J Ollos, 4 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, 4 years ago

Description: modified (diff)

comment:6 by Ryan J Ollos, 4 years ago

Cc: Dirk Stöcker added
Owner: changed from Dirk Stöcker to Ryan J Ollos
Status: newassigned

by Ryan J Ollos, 4 years ago

Attachment: t12133.diff added

comment:7 by Ryan J Ollos, 4 years ago

Proposed changes in t12133.diff.

comment:8 by Ryan J Ollos, 4 years ago

I also propose to bump the version to 1.0.6 (from 1.0.6dev) after this change, and to bump the version more frequently since we no longer have the svn revision in the egg name (#12038).

comment:9 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [14379].

in reply to:  1 comment:10 by Ryan J Ollos, 3 years ago

Replying to Ryan J Ollos:

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

Addressed in r15231.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.