Bug 935943

Summary: Calibre: Plugin update check causes AttributeError
Product: [openSUSE] openSUSE Distribution Reporter: Peter Sütterlin <P.Suetterlin>
Component: KDE ApplicationsAssignee: Sascha Manns <Sascha.Manns>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: cornelis, farcusnz, forgotten_Qn76vasuKu
Version: 13.2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Full error log with traceback
metadata download error log

Description Peter Sütterlin 2015-06-24 16:50:49 UTC
Created attachment 638977 [details]
Full error log with traceback

I am running calibre 2.30.0 from the KDE:Extra repository.  When I try to check for plugin updates (Preferences->(Advanced)Plugins->Check for updated plugins) I get an error message:
AttributeError: 'module' object has no attribute 'create_default_context'
(full log in attachment)
Comment 1 Peter Sütterlin 2015-07-08 16:31:31 UTC
There has been an update to 2.31 in the meantime, but the error is still there.

In addition, it (*) also seems to affect the 'Get Books' search from within calibre: No search does find any books/matches anymore, though I do not get an error message....

(*)just a guess, as both actions (try to) access internet
Comment 2 Mark Fairbairn 2015-08-17 17:53:09 UTC
this is not restricted to plugin update check.
When trying to download metadata similar error is received.
Python fault?
Comment 3 Mark Fairbairn 2015-08-17 17:54:09 UTC
Created attachment 644043 [details]
metadata download error log
Comment 4 Forgotten User Qn76vasuKu 2015-08-19 16:25:04 UTC
Same behavior here :

calibre, version 2.34.0
ERREUR : Échec lors du téléchargement: Le téléchargement des métadonnées a échoué. Cliquer Afficher Détails pour voir les détails

Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/utils/ipc/simple_worker.py", line 274, in main
    res = {'result':func(*args, **kwargs)}
  File "/usr/lib64/calibre/calibre/ebooks/metadata/sources/worker.py", line 103, in single_identify
    identifiers=identifiers)
  File "/usr/lib64/calibre/calibre/ebooks/metadata/sources/identify.py", line 452, in identify
    log('Request extra headers:', plugin.browser.addheaders)
  File "/usr/lib64/calibre/calibre/ebooks/metadata/sources/base.py", line 285, in browser
    self._browser = browser(user_agent=self.user_agent)
  File "/usr/lib64/calibre/calibre/__init__.py", line 403, in browser
    opener = Browser(verify_ssl=verify_ssl_certificates)
  File "/usr/lib64/calibre/calibre/utils/browser.py", line 44, in __init__
    sc = ssl.create_default_context() if kwargs.pop('verify_ssl', True) else ssl._create_unverified_context(cert_reqs=ssl.CERT_NONE)
AttributeError: 'module' object has no attribute 'create_default_context'
Comment 5 Peter Sütterlin 2015-08-19 16:54:34 UTC
This is a dependency issue.  Newer calibre versions require (source: http://calibre-ebook.com/download_linux) at least python 2.7.9 (which introduced the ssl.create_default_context funcion), but standard OS13.2 only has 2.7.8 :(

'rpm -q --requires calibre' only lists python >= 2.7.1, so it's an error in the spec file.....
Comment 6 Mark Fairbairn 2015-12-09 02:42:47 UTC
this issue is not present in Leap 42.1 - I guess due to the newer python being used there.
Comment 7 Cor Blom 2015-12-14 16:04:33 UTC
A python update is not to be expected, so this bug will not be fixed for older distributions.

I have updated the python requirements (and other).
Comment 8 Swamp Workflow Management 2015-12-18 19:10:48 UTC
openSUSE-RU-2015:2301-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 935943
CVE References: 
Sources used:
openSUSE Leap 42.1 (src):    calibre-2.46.0-6.1
Comment 9 Cor Blom 2015-12-18 21:13:28 UTC
*** Bug 937425 has been marked as a duplicate of this bug. ***