Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 684158 - gnome-extra/cinnamon-3.6.6-r2 with dev-python/pillow-6.0.0 - cinnamon-settings: AttributeError: 'module' object has no attribute 'VERSION'
Summary: gnome-extra/cinnamon-3.6.6-r2 with dev-python/pillow-6.0.0 - cinnamon-setting...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Cinnamon Team (DISABLED)
URL:
Whiteboard:
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2019-04-23 07:08 UTC by Garry Filakhtov
Modified: 2019-05-27 13:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Garry Filakhtov 2019-04-23 07:08:17 UTC
Current Cinnamon ebuild, version 3.6.6 is not compatible with Python's PIL library >=dev-python/pillow-6.0.0

$ cinnamon-settings
Traceback (most recent call last):
  File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 45, in <module>
    modules = map(__import__, mod_files)
  File "/usr/share/cinnamon/cinnamon-settings/modules/cs_backgrounds.py", line 5, in <module>
    import imtools
  File "/usr/share/cinnamon/cinnamon-settings/bin/imtools.py", line 622, in <module>
    if Image.VERSION == '1.1.7':
AttributeError: 'module' object has no attribute 'VERSION'

dev-python/pillow should be locked to <6.0.0. Alternatively, following if/else condition can be condensed to just "else" branch:

if Image.VERSION == '1.1.7':

    def split(image):
        """Work around for bug in Pil 1.1.7

        :param image: input image
        :type image: PIL image object
        :returns: the different color bands of the image (eg R, G, B)
        :rtype: tuple
        """
        image.load()
        return image.split()
else:

    def split(image):
        """Work around for bug in Pil 1.1.7

        :param image: input image
        :type image: PIL image object
        :returns: the different color bands of the image (eg R, G, B)
        :rtype: tuple
        """
        return image.split()

inside of the /usr/share/cinnamon/cinnamon-settings/bin/imtools.py file.
Comment 1 Garry Filakhtov 2019-04-23 07:12:17 UTC
Oh, another alternative would be patching the /usr/share/cinnamon/cinnamon-settings/bin/imtools.py file and checking if Image has __version__ attribute instead and rely on that.
Comment 2 Kristian Fiskerstrand (RETIRED) gentoo-dev 2019-04-23 11:36:28 UTC
(In reply to Garry Filakhtov from comment #1)
> Oh, another alternative would be patching the
> /usr/share/cinnamon/cinnamon-settings/bin/imtools.py file and checking if
> Image has __version__ attribute instead and rely on that.

Can you reproduce this issue with 4.0.x? if not it seems like a good reason to stabilize a newer version instead of patching 3.6.
Comment 3 Garry Filakhtov 2019-04-23 22:23:30 UTC
It is still happening in 4.0.x. I have looked into GitHub repo and it seems like it was just recently fixed and the fix is only available in master, no releases has been made yet. See https://github.com/linuxmint/cinnamon/issues/8495
Comment 4 Kristian Fiskerstrand (RETIRED) gentoo-dev 2019-04-24 16:43:44 UTC
(In reply to Garry Filakhtov from comment #3)
> It is still happening in 4.0.x. I have looked into GitHub repo and it seems
> like it was just recently fixed and the fix is only available in master, no
> releases has been made yet. See
> https://github.com/linuxmint/cinnamon/issues/8495

Thanks, that makes it easier to carry a downstream patch if necessary before a new release. Will have a look at it this weekend.
Comment 5 Koz Ross 2019-05-08 22:33:00 UTC
Any progress on this? It's a pretty major breakage, and a downgrade also breaks for me (for an unrelated reason).
Comment 6 Larry the Git Cow gentoo-dev 2019-05-27 13:15:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d906a3b88ab0f31370c7595f8093765b9f0791d

commit 0d906a3b88ab0f31370c7595f8093765b9f0791d
Author:     Kristian Fiskerstrand <k_f@gentoo.org>
AuthorDate: 2019-05-27 13:13:10 +0000
Commit:     Kristian Fiskerstrand <k_f@gentoo.org>
CommitDate: 2019-05-27 13:13:47 +0000

    gnome-extra/cinnamon: Add fix for pillow >= 6.0.0
    
    Closes: https://bugs.gentoo.org/684158
    Signed-off-by: Kristian Fiskerstrand <k_f@gentoo.org>
    Package-Manager: Portage-2.3.66, Repoman-2.3.11

 gnome-extra/cinnamon/cinnamon-4.0.3-r2.ebuild      | 209 +++++++++++++++++++++
 .../files/cinnamon-4.0-fix-pillow-settings.patch   |  43 +++++
 2 files changed, 252 insertions(+)