[Scipy-tickets] [SciPy] #1374: pilutil - PIL import hash collision

SciPy Trac scipy-tickets@scipy....
Fri Jan 28 02:05:23 CST 2011


#1374: pilutil - PIL import hash collision
------------------------+---------------------------------------------------
 Reporter:  klaush      |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  low         |   Milestone:  Unscheduled
Component:  scipy.misc  |     Version:  0.8.0      
 Keywords:              |  
------------------------+---------------------------------------------------
 Disclaimer: I'm by no means a Python expert, so maybe this doesn't even
 count as a bug... :-)

 To reproduce the unwanted behavior:

 {{{
 Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
 (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import scipy
 >>> import VideoCapture
 AccessInit: hash collision: 3 for both 1 and 1
 }}}

 I have tracked down the problem to the way PIL is imported. In the
 videocapture module the following line can be found:

 {{{
 from PIL import Image, ImageFont, ImageDraw
 }}}

 whereas the scipy.misc.pilutil use this convention:

 {{{
 import Image
 import ImageFilter
 }}}

 According to http://jaredforsyth.com/blog/2010/apr/28/accessinit-hash-
 collision-3-both-1-and-1/ the solution is to import PIL in the same way.
 If I change the two lines in pilutil.py to

 {{{
 from PIL import Image, ImageFilter
 }}}


 everything works fine. Should this be changed or is the current version
 the preferred way to load PIL?

 By the way - thanks for the awesome work you do on scipy :-D

 /Klaus

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1374>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list