FS#64187 - [hplip] hp-doctor fails due to Pillow removed VERSION in version 6.0.0

Attached to Project: Arch Linux
Opened by Stefan Förster (HotblackDesiato) - Sunday, 20 October 2019, 11:14 GMT
Last edited by Andreas Radke (AndyRTR) - Thursday, 24 October 2019, 19:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

hp-doctor fails because the VERSION attribute was removed in current Pillow version 6.0.0:

Traceback (most recent call last):
File "/usr/bin/hp-doctor", line 297, in <module>
num_errors, num_warns = dep.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, False)
File "/usr/share/hplip/check.py", line 368, in validate
self.core.dependencies[dep])
File "/usr/share/hplip/check.py", line 210, in __update_deps_info
installed_ver = self.core.version_func[deps_info[6]]()
File "/usr/share/hplip/installer/dcheck.py", line 373, in get_pil_version
return Image.VERSION
AttributeError: module 'PIL.Image' has no attribute 'VERSION'

Pillow still has the PILLOW_VERSION attribute, which is deprecated and will be removed in version 7.0.0.

I manually patched the file /usr/share/hplip/installer/dcheck.py as follows:

def get_pil_version():
try:
from PIL import Image
except ImportError:
return '-'
else:
return Image.PILLOW_VERSION

i.e. I use Image.PILLOW_VERSION instead of Image.VERSION.

This solved the problem - but this will return when Pillow is updated to version 7.0.0.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Thursday, 24 October 2019, 19:08 GMT
Reason for closing:  Fixed
Comment by Andreas Radke (AndyRTR) - Sunday, 20 October 2019, 11:27 GMT Comment by Stefan Förster (HotblackDesiato) - Sunday, 20 October 2019, 13:33 GMT
Yes, it looks like it.
Comment by Andreas Radke (AndyRTR) - Sunday, 20 October 2019, 13:53 GMT
Please check 3.19.8-2 in testing repo.

Loading...