DD063520 added a comment.

  Ok, to give back the error message to the user I propose the following change:
  
  if I modify these lines:
  
https://github.com/wikimedia/pywikibot/blob/26deab88936cbf85aa24e1ddfc9b62e81d80a9bb/pywikibot/data/api.py#L2040
  
  to
  
    print("result2 ", result)
    # Phab. tickets T48535, T64126, T68494, T68619
    if code == 'failed-save' and \
       self.action == 'wbeditentity' and \
       self._is_wikibase_error_retryable(result['error']):
       self.wait()
       continue
    print("result 3 ", result)
  
  I get:
  
    result2  {'error': {'code': 'failed-save', 'info': 'The save has failed.', 
'messages': [{'name': 'wikibase-api-failed-save', 'parameters': [], 'html': 
{'*': 'The save has failed.'}}, {'name': 'wikibase-validator-label-conflict', 
'parameters': ['localisation administrative', 'fr', '[[Property:P27|P27]]'], 
'html': {'*': 'Property <a href="/wiki/Property:P27" 
title="Property:P27">P27</a> already has label "localisation administrative" 
associated with language code fr.'}}, {'name': 
'wikibase-validator-label-conflict', 'parameters': ['located in the 
administrative territorial entity', 'en', '[[Property:P27|P27]]'], 'html': 
{'*': 'Property <a href="/wiki/Property:P27" ......................
    result 3  {'error': {'code': 'failed-save', 'info': 'The save has failed.', 
'help': 'See http://localhost:8181/w/api.php for API usage. Subscribe to the 
mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.'}}
  
  So the message is eaten up. This happens in the 
self._is_wikibase_error_retryable function:
  
  
https://github.com/wikimedia/pywikibot/blob/26deab88936cbf85aa24e1ddfc9b62e81d80a9bb/pywikibot/data/api.py#L1615
  
  There a pop is used to retrieve the message which is then lost afterwords. 
Can someone fix this?

TASK DETAIL
  https://phabricator.wikimedia.org/T235500

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: DD063520
Cc: Aklapper, DD063520, pywikibot-bugs-list, Zkhalido, Jelabra, Viztor, 
DannyS712, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, _jensen, Altostratus, 
Avicennasis, Asahiko, mys_721tx, Wikidata-bugs, jayvdb, Ricordisamoa, Dalba, 
Masti, Alchimista, Addshore, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to