• 
      

    Update PIL import

    Review Request #7876 — Created Jan. 15, 2016 and submitted

    Information

    Djblets
    release-0.8.x

    Reviewers

    Previously, if PIL's Image library could not be imported, the Image
    module would be imported. However, this is not a good way to import PIL
    becuase it masks the errors from the first import, which can occur if
    some dependencies (such as libtiff or libjpeg) are missing.

    • Ran unit tests.
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          djblets/util/templatetags/djblets_images.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          djblets/util/templatetags/djblets_images.py
      
      
    2. 
        
    mike_conley
    1. According to this link this suggests that it was around 2011 / PIL 1.2 that the decision was made to change importing behaviour so that you can't import Image from the global namespace. However, the PIL website says that the current release is 1.1.7...

      So it's not clear to me what configurations we might be breaking here. Is it possible that there are instances of Review Board (or other Djblets apps) out there running versions of PIL that rely on import Image, and if so, do we care about them?

    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-0.9.x (69c43fb)