harmtemolder / koreader-calibre-plugin

A calibre plugin to synchronize metadata from KOReader to calibre
GNU General Public License v3.0
60 stars 6 forks source link

TypeError: '<' not supported between instances of 'str' and 'int' #20

Closed charleshan closed 2 months ago

charleshan commented 6 months ago

calibre, version 7.5.1 ERROR: Unhandled exception: TypeError:'<' not supported between instances of 'str' and 'int'

calibre 7.5.1 embedded-python: True macOS-13.6.1-arm64-arm-64bit Darwin ('64bit', '') ('Darwin', '22.6.0', 'Darwin Kernel Version 22.6.0: Wed Oct 4 21:25:40 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_ARM64_T8103') Python 3.11.5 OSX: ('13.6.1', ('', '', ''), 'arm64') Interface language: None EXE path: /Applications/calibre.app/Contents/MacOS/calibre Successfully initialized third party plugins: Count Pages (1, 13, 5) && Hyphenate This! (0, 1, 3) && KOReader Sync (0, 5, 2) Traceback (most recent call last): File "calibre_plugins.koreader.action", line 749, in sync_to_calibre value = column'transform' ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "calibre_plugins.koreader.config", line 156, in 'transform': (lambda d: json.dumps( ^^^^^^^^^^^ File "json/init.py", line 238, in dumps File "json/encoder.py", line 202, in encode File "json/encoder.py", line 432, in _iterencode File "json/encoder.py", line 406, in _iterencode_dict File "json/encoder.py", line 354, in _iterencode_dict TypeError: '<' not supported between instances of 'str' and 'int'

WillScarlettOhara commented 6 months ago

Hi same problem when I try to retrieve sideload from KOReader on a plein text raw column.

calibre, version 7.7.0
ERROR: Unhandled exception: <b>TypeError</b>:'&lt;' not supported between instances of 'str' and 'int'

calibre 7.7  embedded-python: True
Windows-10-10.0.22631-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22631')
Python 3.11.5
Windows: ('10', '10.0.22631', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre.exe
Successfully initialized third party plugins: DeDRM (10, 0, 3) && Amazon.com Multiple Countries (1, 0, 0) && Annotations (1, 17, 13) && Babelio Notes (5, 0, 0) && Babelio_db (0, 8, 6) && Clean Metadata (0, 0, 6) && Count Pages (1, 13, 5) && Ebook Translator (2, 3, 3) && Editor Chains (1, 1, 6) && Extract ISBN (1, 6, 1) && Find Duplicates (1, 10, 9) && Goodreads (1, 8, 1) && Goodreads More Tags (1, 2, 1, 2) && Goodreads Sync (1, 16, 5) && KOReader Sync (0, 5, 2) && Kobo Books (1, 9, 2) && Kobo Metadata (1, 5, 0) && Kobo Utilities (2, 16, 13) && Manage Series (1, 5, 2) && Mass Search-Replace (1, 8, 2) && Obok DeDRM (10, 0, 3) && Quality Check (1, 13, 10) && Reading List (1, 15, 2) && Search The Internet (1, 11, 1) && TextDiff (1, 2, 4) && Wikidata (2, 0, 0)
Traceback (most recent call last):
  File "calibre_plugins.koreader.action", line 749, in sync_to_calibre
  File "calibre_plugins.koreader.config", line 156, in <lambda>
  File "json\__init__.py", line 238, in dumps
  File "json\encoder.py", line 202, in encode
  File "json\encoder.py", line 432, in _iterencode
  File "json\encoder.py", line 406, in _iterencode_dict
  File "json\encoder.py", line 354, in _iterencode_dict
TypeError: '<' not supported between instances of 'str' and 'int'
sztanj commented 6 months ago

Hi, I receive same error when attempting to fetch various columns to calibre. (A reading progress column, ratings, several text columns, etc.) My setup worked successfully until a couple months ago.

calibre, version 6.28.1
ERROR: Unhandled exception: <b>TypeError</b>:'&lt;' not supported between instances of 'str' and 'int'

calibre 6.28.1  embedded-python: True
Windows-10-10.0.22631-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22631')
Python 3.10.1
Windows: ('10', '10.0.22631', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 9) && Count Pages (1, 13, 5) && FanFicFare (4, 33, 0) && KOReader Sync (0, 5, 2) && Kobo Utilities (2, 16, 13) && KoboTouchExtended (3, 6, 7) && Obok DeDRM (10, 0, 9) && Reading List (1, 15, 2)
Traceback (most recent call last):
  File "calibre_plugins.koreader.action", line 749, in sync_to_calibre
  File "calibre_plugins.koreader.config", line 156, in <lambda>
  File "json\__init__.py", line 238, in dumps
  File "json\encoder.py", line 201, in encode
  File "json\encoder.py", line 431, in _iterencode
  File "json\encoder.py", line 405, in _iterencode_dict
  File "json\encoder.py", line 353, in _iterencode_dict
TypeError: '<' not supported between instances of 'str' and 'int'
kyxap commented 4 months ago

same issue I'm not sure if its calibre specific ver related, seems like more the way that python parsing works

calibre, version 7.11.0
ERROR: Unhandled exception: <b>TypeError</b>:'&lt;' not supported between instances of 'str' and 'int'

calibre 7.11  embedded-python: True
Windows-10-10.0.22631-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22631')
Python 3.11.5
Windows: ('10', '10.0.22631', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre.exe
Successfully initialized third party plugins: Goodreads Sync (1, 16, 6) && KOReader Sync (0, 5, 2)
Traceback (most recent call last):
  File "calibre_plugins.koreader.action", line 756, in sync_to_calibre
  File "calibre_plugins.koreader.config", line 156, in <lambda>
  File "json\__init__.py", line 238, in dumps
  File "json\encoder.py", line 202, in encode
  File "json\encoder.py", line 432, in _iterencode
  File "json\encoder.py", line 406, in _iterencode_dict
  File "json\encoder.py", line 354, in _iterencode_dict
TypeError: '<' not supported between instances of 'str' and 'int'
kyxap commented 4 months ago

Hey all, I've created PR #24 which should fix the issue, anyone want to try and report if issue is resolved?

kyxap commented 2 months ago

check latest release it fixed there

sztanj commented 1 month ago

Thanks so much for this fix! I confirm I no longer get this error in the latest release.