Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 708742 - app-text/calibre-4.10.1 [python_single_target_python3_6]: error on send/remove book on kobo device
Summary: app-text/calibre-4.10.1 [python_single_target_python3_6]: error on send/remov...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ian Stakenvicius (RETIRED)
URL: https://github.com/kovidgoyal/calibre...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-08 17:46 UTC by Marco Genasci
Modified: 2020-02-10 07:30 UTC (History)
2 users (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 Marco Genasci 2020-02-08 17:46:01 UTC
Calibre return error 
calibre, version 4.10.1
ERROR: Error: Error communicating with device

'>' not supported between instances of 'float' and 'str'

Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/gui2/device.py", line 90, in run
    self.result = self.func(*self.args, **self.kwargs)
  File "/usr/lib64/calibre/calibre/gui2/device.py", line 543, in _sync_booklists
    self.device.sync_booklists(booklists, end_session=False)
  File "/usr/lib64/calibre/calibre/devices/kobo/driver.py", line 970, in sync_booklists
    self.update_device_database_collections(blist, collections, oncard)
  File "/usr/lib64/calibre/calibre/devices/kobo/driver.py", line 2398, in update_device_database_collections
    collections = booklists.get_collections(collections_attributes) if bookshelf_attribute else None
  File "/usr/lib64/calibre/calibre/devices/kobo/books.py", line 314, in get_collections
    books = sorted(itervalues(lpaths), key=cmp_to_key(none_cmp))
  File "/usr/lib64/calibre/calibre/devices/kobo/books.py", line 307, in none_cmp
    c = cmp(x, y)
  File "/usr/lib64/calibre/polyglot/builtins.py", line 106, in cmp
    return (a > b) - (a < b)
TypeError: '>' not supported between instances of 'float' and 'str'

when send or remove a book on kobo device. With python_single_target_python2_7 calibre not return error.

Reproducible: Always
Comment 1 Jonas Stein gentoo-dev 2020-02-08 21:24:46 UTC
Please check, if it is this upstream bug:

https://bugs.launchpad.net/calibre/+bug/1044557
Comment 2 Marco Genasci 2020-02-09 09:52:57 UTC
(In reply to Jonas Stein from comment #1)
> Please check, if it is this upstream bug:
> 
> https://bugs.launchpad.net/calibre/+bug/1044557

I think yes, but my point of view is if would not be better to force set python_single_target_python2_7 use flag to calibre at least in stable branch.
Comment 3 Larry the Git Cow gentoo-dev 2020-02-09 20:50:31 UTC
The bug has been closed via the following commit(s):

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

commit e2488d93b0267444a7e14c52da34e31ec0b97e18
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-02-09 20:46:19 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-02-09 20:50:24 +0000

    app-text/calibre: kobo py3 fix for bug 708742
    
    Closes: https://bugs.gentoo.org/708742
    Package-Manager: Portage-2.3.88, Repoman-2.3.20
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 ...e-4.10.1-r1.ebuild => calibre-4.10.1-r2.ebuild} |  3 +-
 ...bre-4.9.1-r1.ebuild => calibre-4.9.1-r2.ebuild} |  3 +-
 ...Ignore-TypeError-sorting-collections-kobo.patch | 63 ++++++++++++++++++++++
 3 files changed, 67 insertions(+), 2 deletions(-)
Comment 4 Zac Medico gentoo-dev 2020-02-09 20:54:39 UTC
(In reply to Marco Genasci from comment #2)
> (In reply to Jonas Stein from comment #1)
> > Please check, if it is this upstream bug:
> > 
> > https://bugs.launchpad.net/calibre/+bug/1044557
> 
> I think yes, but my point of view is if would not be better to force set
> python_single_target_python2_7 use flag to calibre at least in stable branch.

Generally python3 porting issues are fairly easy to fix. My hope is that enabling python3 in stable will not inconvenience people too much, and it will help us eliminate the need for python2 sooner.

Thanks for the report!
Comment 5 Marco Genasci 2020-02-10 07:30:44 UTC
(In reply to Zac Medico from comment #4)
> Generally python3 porting issues are fairly easy to fix.
I figured it wasn't too complicated, unfortunately I'm not familiar with Python and I couldn't make a patch.


(In reply to Zac Medico from comment #4)
> My hope is that enabling python3 in stable will not 
> inconvenience people too much, and it will help us 
> eliminate the need for python2 sooner.
That seems to make sense :).

Thank you for you great work in gentoo