Could not add extra lookup sources

Bug #1992278 reported by Vaughn Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

hi, I could not add another lookup sources. e.g: DuckDuckGo https://duckduckgo.com/{word}
More details here:

calibre, version 6.6.1
ERROR: Unhandled exception: <b>TypeError</b>:&lt;function google_dictionary at 0x1140b8f70&gt; is not JSON serializable

calibre 6.6.1 embedded-python: True
macOS-12.6-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '21.6.0', 'Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64')
Python 3.10.1
OSX: ('12.6', ('', '', ''), 'x86_64')
Interface language: None
Traceback (most recent call last):
  File "calibre/gui2/viewer/lookup.py", line 205, in accept
  File "calibre/utils/config.py", line 429, in __setitem__
  File "calibre/utils/config.py", line 395, in commit
  File "calibre/utils/config.py", line 413, in to_raw
  File "calibre/utils/config_base.py", line 109, in json_dumps
  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 325, in _iterencode_list
  File "json/encoder.py", line 405, in _iterencode_dict
  File "json/encoder.py", line 438, in _iterencode
  File "calibre/utils/config_base.py", line 62, in to_json
TypeError: <function google_dictionary at 0x1140b8f70> is not JSON serializable

Since Google dictionary triggers its annoying CAPTCHA, hope more sources could be added.
Thank you in advance.

Revision history for this message
Vaughn Li (vaughnli) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.