Task #2597 (closed)
"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)"
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
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 12 years ago by wmoore
- Description modified (diff)
(In [7562]) Marking all uses of PIL with "see #2597"