Last modified: 2014-05-30 07:04:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57000, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55000 - claimit.py: lang for source lookup
claimit.py: lang for source lookup
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
unspecified
All All
: Unprioritized enhancement
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:02 UTC by Kunal Mehta (Legoktm)
Modified: 2014-05-30 07:04 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:02:38 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/346/
Reported by: apac1
Created on: 2013-08-31 12:40:09.399000
Subject: claimit.py: lang for source lookup
Assigned to: legoktm
Original description:
    def setSource(self, lang):

        page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python')
        source_values = json.loads(page.get())
        source_values = source_values['wikipedia']
        for lang in source_values:
            source_values[lang] = pywikibot.ItemPage(self.repo,
                                                     source_values[lang])

        if lang in source_values:
            self.source = pywikibot.Claim(self.repo, 'p143')
            self.source.setTarget(source_values.get(lang))

The use of lang in "for lang in source_values:" overwrites the lang in "def setSource(self, lang)". This leads to incorrect results. "lang" should be the language of the source wiki. For -cat:"zh:Category:Somevalue" this would be "zh".
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:02:40 UTC
- **status**: open --> pending
- **assigned_to**: Legoktm
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:02:42 UTC
https://gerrit.wikimedia.org/r/#/c/82106/
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:02:43 UTC
In the init part

    self.setSource(pywikibot.Site().language())

might also need changing.




Currently, if in the config file there is
    
    family = 'wikipedia'
    mylang = 'en'
    
and claimit is called with
    
    -cat:zh:Category:Somevalue
    
this leads to "en" to be used, instead of "zh".
Comment 4 John Mark Vandenberg 2014-05-30 07:04:06 UTC
(In reply to Kunal Mehta (Legoktm) from comment #3)
> In the init part
> 
>     self.setSource(pywikibot.Site().language())
> 
> might also need changing.

This was fixed by Legoktm in

https://gerrit.wikimedia.org/r/#/c/82263/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links