FS#73432 - [calibre] Selecting highlights causes exception in ePub viewer due to float type

Attached to Project: Community Packages
Opened by Jarrod Farrell (jarrodfarrell) - Thursday, 20 January 2022, 16:15 GMT
Last edited by Antonio Rojas (arojas) - Friday, 21 January 2022, 18:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Caleb Maclennan (alerque)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Coming from: https://bugs.launchpad.net/calibre/+bug/1958350

calibre, version 5.34.0
ERROR: Unhandled exception: <b>TypeError</b>:setMaximumHeight(self, int): argument 1 has unexpected type 'float'

calibre 5.34 embedded-python: False is64bit: True
Linux-5.15.12-1-MANJARO-x86_64-with-glibc2.33 Linux ('64bit', 'ELF')
('Linux', '5.15.12-1-MANJARO', '#1 SMP PREEMPT Wed Dec 29 18:08:07 UTC 2021')
Python 3.10.1
Interface language: None
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/viewer/highlights.py", line 507, in current_highlight_changed
nd.show_notes()
File "/usr/lib/calibre/calibre/gui2/viewer/highlights.py", line 408, in show_notes
self.setMaximumHeight(h)
TypeError: setMaximumHeight(self, int): argument 1 has unexpected type 'float'

Affected line https://github.com/kovidgoyal/calibre/blob/eb78a761a99ac20a6364f85e12059fec6517d890/src/calibre/gui2/viewer/highlights.py#L406

Fixed by surrounding the expression with `int()` to convert it from a float to int. Double-clicking a highlight will select the entire highlight instead of erroring and selecting a word.

FROM ORIGINAL BUG LOCATION:
"This is a bug in your distro calibre package (it updated to python 3.10
without waiting checking if the python software it packages is
compatible)." - Kovid Goyal (kovid)
This task depends upon

Closed by  Antonio Rojas (arojas)
Friday, 21 January 2022, 18:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  calibre 5.35.0
Comment by Michel Koss (MichelKoss1) - Friday, 21 January 2022, 14:24 GMT
"Linux-5.15.12-1-MANJARO-x86"

You aren't using Arch Linux
Comment by Antonio Rojas (arojas) - Friday, 21 January 2022, 15:14 GMT
That's irrelevant because this is really an upstream issue, that the developer decided to ignore because he doesn't care about distro packages.
Comment by Michel Koss (MichelKoss1) - Friday, 21 January 2022, 18:07 GMT
I've seen many issues closed only because they didn't came from Arch Linux users regardless of its relevancy for Arch. If the policy has changed then it's fine for me.
Comment by Antonio Rojas (arojas) - Friday, 21 January 2022, 18:41 GMT
The policy hasn't changed, but closing a bug that obviously affects Arch just because the reporter uses Manjaro is taking to rules too far I think.

Anyway, this was fixed two weeks ago and the fix was released in 5.35.0 today (on Arch, not Manjaro). The developer obviously knew it but he decided to close the bug as downstream instead of just saying so. So nice of him.

Loading...