Ticket #5883 (closed Bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

PIL not found by plone when installed as an egg

Reported by: brcwhit Owned by:
Priority: major Milestone: 3.0rc1
Component: Infrastructure Keywords: eggs easy_install PIL
Cc: ianb@…

Description

"import PIL" is a sideffect of installing PIL via distutils. easy_install install Image etc as toplevel packages.

Change History

comment:1 Changed 5 years ago by dreamcatcher

Can you be more specific? PIL comes with the installer. What is the issue?

comment:2 Changed 5 years ago by ianb

PIL is installed so that all its modules become top-level modules. E.g., you can do import Image instead of from PIL import Image -- PIL ends up being a package because distutils lets you be vague about how you setup modules. But setuptools does not let you be vague in this way, so it only sets up the top-level packages as indicated in PIL's setup.py

comment:3 Changed 5 years ago by ianb

  • Cc ianb@… added

comment:4 Changed 5 years ago by dreamcatcher

So what is the issue?

  • Is it that the installer is doing the wrong thing?
  • Is it a bug in PIL's setup.py?
  • Is it a bug in the way Plone is importing PIL?
  • Do you get a traceback?

comment:5 Changed 5 years ago by brcwhit

  • Owner changed from dreamcatcher to somebody
  • Component changed from Installers to Unknown

comment:6 Changed 5 years ago by ianb

This is a bug in the way PIL is imported in Plone.

comment:7 Changed 5 years ago by ianb

Here's all the files with PIL package references:

CMFPlone/MembershipTool.py
CMFPlone/utils.py
CMFPlone/MigrationTool.py
ATContentTypes/config.py
Archetypes/Field.py
CMFPlone/setup/dependencies.py
ATContentTypes/lib/imagetransform.py
ATContentTypes/configuration/datatype.py
PortalTransforms/libtransforms/piltransform.py

comment:8 Changed 5 years ago by limi

  • Component changed from Unknown to Infrastructure
  • Milestone changed from 3.0.x to 3.0

Should be corrected in Plone 3.0 (or in 2.5.x if we can do it without any side effects).

Ian, do you need commit privileges to Plone and the Collective? I assume this is an easy fix for the people that know how. :)

comment:9 follow-up: ↓ 10 Changed 5 years ago by hannosch

  • Milestone changed from 3.0 to 3.0.x

comment:10 in reply to: ↑ 9 Changed 5 years ago by nouri

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r12150

comment:11 in reply to: ↑ description Changed 5 years ago by nouri

  • Status changed from closed to reopened
  • Resolution fixed deleted

My fix in r12150 exposes another problem. As Sidnei pointed out, there is a top-level Image in Zope, so they conflict when you're unlucky.

Anyone have an idea of how to fix this? I desperately want PIL to be easy_installable for Plone.

comment:12 Changed 5 years ago by optilude

Is the problem not PIL? It seems pretty lame to me that it should spam the top level namespace with things as common as Image (equally lame of Zope, of course).

I would much rather do 'from PIL import Image' than 'import Image'.

comment:13 Changed 5 years ago by hannosch

  • Status changed from reopened to closed
  • Resolution set to wontfix

I agree with Martin that this is a bug in the PIL egg and not in Plone.

Note: See TracTickets for help on using tickets.