Page MenuHomePhabricator

reflinks.py [SSL: CERTIFICATE_VERIFY_FAILED]
Closed, ResolvedPublic

Description

$ python pwb.py reflinks.py -start:'103rd Street' -lang:pl
Retrieving 50 pages from wikipedia:pl.
No changes were needed on [[103rd Street]]
WARNING : media : http://web.archive.org/web/20130516220951/http://www.metro.net/riding_metro/maps/images/blue_all.pdf 
Traceback (most recent call last):
  File "pwb.py", line 263, in <module>
    if not main():
  File "pwb.py", line 256, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "./scripts/m-reflinks.py", line 804, in <module>
    main()
  File "./scripts/m-reflinks.py", line 799, in main
    bot.run()
  File "./scripts/m-reflinks.py", line 532, in run
    ref.url, use_fake_user_agent=self._use_fake_user_agent)
  File "/home/mst/pw/core/pywikibot/comms/http.py", line 511, in fetch
    error_handling_callback(request)
  File "/home/mst/pw/core/pywikibot/comms/http.py", line 394, in error_handling_callback
    raise FatalServerError(str(request.data))
pywikibot.exceptions.FatalServerError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
<class 'pywikibot.exceptions.FatalServerError'>
CRITICAL: Closing network session.
$ python pwb.py version.py
Pywikibot: [https] r-pywikibot-core (cef9adf, g8737, 2017/11/05, 23:21:04, n/a)
Release version: 3.0-dev
requests version: 2.6.0
  cacerts: /etc/pki/tls/certs/ca-bundle.crt
    certificate test: ok
Python: 2.7.5 (default, May  3 2017, 07:55:04) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: 
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: /home/mst/pw/core

It looks that the Error is not catched in the try clause.
solution in the diff attached

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Masti: Thanks for taking a look at the code! You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review them quickly and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader.

Change 391077 had a related patch set uploaded (by Gerrit Patch Uploader; owner: [[mw:user:masti]]):
[pywikibot/core@master] reflinks handle FatalServerError & Server504Error [T180308]

https://gerrit.wikimedia.org/r/391077

Change 391077 had a related patch set uploaded (by Framawiki; owner: [[mw:user:masti]]):
[pywikibot/core@master] [FIX] reflinks: handle FatalServerError & Server504Error

https://gerrit.wikimedia.org/r/391077

Change 391077 merged by jenkins-bot:
[pywikibot/core@master] [FIX] reflinks: handle FatalServerError & Server504Error

https://gerrit.wikimedia.org/r/391077

Framawiki claimed this task.
Framawiki reassigned this task from Framawiki to Masti.