Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #2597 (closed)

Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

"import PIL" may fail in some cases

Reported by: jamoore Owned by: jamoore
Priority: blocker Milestone: OMERO-Beta4.2
Component: Deployment Version: n.a.
Keywords: n.a. Cc: cneves, atarkowska, cblackburn, cxallan
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: n.a.

Description (last modified by wmoore)

Depending on how PIL was installed, it may should be imported as import Image or from PIL import Image.

However, in some cases, BOTH may work and cause failures: See #9790.
Therefore it is essential that they are done IN THE SAME ORDER every time.

In all OMERO uses, both should be attempt in a try/except block in this order:

try:
    from PIL import Image, ImageDraw, ImageFont     # see ticket:2597
except: #pragma: nocover
    try:
        import Image, ImageDraw, ImageFont          # see ticket:2597
    except:
        logger.error('No PIL installed')

Searching for any import of PIL should also show this ticket number:

$ git grep "import Image"

Therefore, this should show NOTHING:

:OmeroPy will$ git grep "import Image" | grep -v ticket:2597 | grep -vE "(ImageI|ImageAnnotationLinkI|ImageWrapper|ImageColumn|ImageData)"

See: http://code.djangoproject.com/ticket/6054

Change History (5)

comment:1 Changed 14 years ago by jmoore

  • Owner set to jmoore
  • Status changed from new to assigned

comment:2 Changed 14 years ago by jmoore

(In [7562]) Marking all uses of PIL with "see #2597"

comment:3 Changed 14 years ago by jmoore

(In [7564]) Marking all uses of PIL with "see #2597"

original-svn-id: file:///home/svn/omero/branches/Beta4.2@7562 05709c45-44f0-0310-885b-81a1db45b4a6

comment:4 Changed 14 years ago by jmoore

  • Remaining Time changed from 0.25 to 0
  • Resolution set to fixed
  • Status changed from assigned to closed

comment:5 Changed 11 years ago by wmoore

  • Description modified (diff)
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.69001 sec.)

We're Hiring!