Yamaha5 added subscribers: Ladsgroup, Yamaha5.
Yamaha5 added a comment.

I had the same problem with help of @Ladsgroup. Now it works.
At pywikibot/__init__.py: please, someone, replace these codes. it will solve the bug.

def fromWikibase(cls, wb):
    """
    Create a WbQuanity from the JSON data given by the Wikibase API.

    @param wb: Wikibase JSON
    @type wb: dict
    @rtype: pywikibot.WbQuanity
    """
    amount = cls._todecimal(wb['amount'])
    upperBound = cls._todecimal(wb['upperBound'])
    lowerBound = cls._todecimal(wb['lowerBound'])
    error = (upperBound - amount, amount - lowerBound)
    return cls(amount, wb['unit'], error)

with

def fromWikibase(cls, wb):
    """
    Create a WbQuanity from the JSON data given by the Wikibase API.

    @param wb: Wikibase JSON
    @type wb: dict
    @rtype: pywikibot.WbQuanity
    """
    amount = cls._todecimal(wb['amount'])
    if 'upperBound' in wb:
        upperBound = cls._todecimal(wb['upperBound'])
    else:
        upperBound = None

    if 'lowerBound' in wb:
        lowerBound = cls._todecimal(wb['lowerBound'])
    else:
        lowerBound = None
    if upperBound is None or lowerBound is None:
        error = 0
    else:
        error = (upperBound - amount, amount - lowerBound)
    return cls(amount, wb['unit'], error)

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

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

To: Magul, Yamaha5
Cc: Yamaha5, Ladsgroup, XXN, Horcrux92, pywikibot-bugs-list, ChongDae, Aklapper, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to