https://bugzilla.wikimedia.org/show_bug.cgi?id=65940
Bug ID: 65940 Summary: Bot crashes on quanitity Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: Wikidata Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: maarten@mdammers.nl Web browser: --- Mobile Platform: ---
Bot tries to parse https://www.wikidata.org/wiki/Q156578 (api: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q156578&...).
When it hits:
<qualifiers hash="a547d1ffad0cb4fd780b1ec0bf357c4a04db1fd6" snaktype="value" property="P1107" datatype="quantity"> <datavalue type="quantity"> <value amount="+0.9955" unit="1" upperBound="+0.9956" lowerBound="+0.9954" /> </datavalue> </qualifiers>
It goes down in flames:
Adding 52.2203, 21.0256 to Q4504785 Working on Volkswagen AG Traceback (most recent call last): File "pwb.py", line 143, in <module> run_python_file(fn, argv, argvu) File "pwb.py", line 67, in run_python_file exec(compile(source, filename, "exec"), main_mod.__dict__) File "scripts/coordinate_import.py", line 91, in <module> main() File "scripts/coordinate_import.py", line 88, in main coordbot.run() File "scripts/coordinate_import.py", line 54, in run if item.exists(): File "/home/mdammers/pywikibot/core/pywikibot/page.py", line 2451, in exists self.get() File "/home/mdammers/pywikibot/core/pywikibot/page.py", line 2640, in get c = Claim.fromJSON(self.repo, claim) File "/home/mdammers/pywikibot/core/pywikibot/page.py", line 2888, in fromJSON qual = Claim.qualifierFromJSON(site, qualifier) File "/home/mdammers/pywikibot/core/pywikibot/page.py", line 2915, in qualifierFromJSON return Claim.fromJSON(site, wrap) File "/home/mdammers/pywikibot/core/pywikibot/page.py", line 2876, in fromJSON claim.target = pywikibot.WbQuantity.fromWikibase(value) File "/home/mdammers/pywikibot/core/pywikibot/__init__.py", line 358, in fromWikibase amount = long(wb[u'amount']) ValueError: invalid literal for long() with base 10: '+0.9955' <type 'exceptions.ValueError'>
https://bugzilla.wikimedia.org/show_bug.cgi?id=65940
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |info@gno.de Resolution|--- |DUPLICATE
--- Comment #1 from xqt info@gno.de ---
*** This bug has been marked as a duplicate of bug 65758 ***
https://bugzilla.wikimedia.org/show_bug.cgi?id=65940
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Summary|Bot crashes on quanitity |Bot crashes on quantity
pywikipedia-bugs@lists.wikimedia.org