ivanhercaz / ivanhercaz/CanaryBot

Error exception when the full stop is separated of the last word

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
No language data
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This issue is derived from #1. The description that caused the error was the it-desc of the item Q178493.

  Q178493
 - it-desc:     calciatore senegalese  . 
 + Replacement: calciatore senegalese

The stack trace say the error is because the script try to add the same description, so it got an APIError. The reason why this happened might be due the regular expression used to match the full stop:

item.descriptions[key] = re.sub("\\.$", redFullStop, item.descriptions[key])

But I have to check it yet.

Stack trace:

Q178493 it-desc full stop removed                                                                                                    
WARNING: API error modification-failed: Item [[Q2821366|Q2821366]] already has label "Abdoulaye Diallo" associated with language code
using the same description text.                                                                                                     
Edit to page [[wikidata:Q178493]] failed:                                                                                            
modification-failed: Item [[Q2821366|Q2821366]] already has label "Abdoulaye Diallo" associated with language code it, using the same
ription text. [messages:[{'name': 'wikibase-validator-label-with-description-conflict', 'parameters': ['Abdoulaye Diallo', 'it', '[[Q
66|Q2821366]]'], 'html': {'*': 'El elemento <a href="/wiki/Q2821366" title="Q2821366">Q2821366</a> ya tiene la etiqueta "Abdoulaye Di
 asociada con el código de idioma it, usando el mismo texto de descripción.'}}]; help:See https://www.wikidata.org/w/api.php for API 
. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt;
notice of API deprecations and breaking changes.]                                                                                    
                                                                                                                                     
Updating log...                                                                                                                      
                                                                                                                                     
Traceback (most recent call last):                                                                                                   
  File "/srv/paws/pwb/pywikibot/page.py", line 118, in handle                                                                        
    func(self, *args, **kwargs)                                                                                                      
  File "/srv/paws/pwb/pywikibot/page.py", line 4059, in editEntity                                                                   
    baserevid=baserevid, **kwargs)                                                                                                   
  File "/srv/paws/pwb/pywikibot/site.py", line 1312, in callee                                                                       
    return fn(self, *args, **kwargs)                                                                                                 
  File "/srv/paws/pwb/pywikibot/site.py", line 7668, in editEntity                                                                   
    data = req.submit()                                                                                                              
  File "/srv/paws/pwb/pywikibot/data/api.py", line 2195, in submit                                                                   
    raise APIError(**result['error'])                                                                                                
pywikibot.data.api.APIError: modification-failed: Item [[Q2821366|Q2821366]] already has label "Abdoulaye Diallo" associated with lan
 code it, using the same description text. [messages:[{'name': 'wikibase-validator-label-with-description-conflict', 'parameters': ['
laye Diallo', 'it', '[[Q2821366|Q2821366]]'], 'html': {'*': 'El elemento <a href="/wiki/Q2821366" title="Q2821366">Q2821366</a> ya ti
a etiqueta "Abdoulaye Diallo" asociada con el código de idioma it, usando el mismo texto de descripción.'}}]; help:See https://www.wi
a.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listin
diawiki-api-announce&gt; for notice of API deprecations and breaking changes.]          

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the re.sub expression shown in the issue and trace the editEntity path in pywikibot/page.py and pywikibot/site.py. Reproduce the Q178493 description case and verify that separating the full stop no longer causes a duplicate-description APIError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.