Last modified: 2014-11-01 07:13:02 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 T67940, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65940 - Bot crashes on quantity
Bot crashes on quantity
Status: RESOLVED DUPLICATE of bug 65758
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-30 09:30 UTC by Maarten Dammers
Modified: 2014-11-01 07:13 UTC (History)
2 users (show)

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


Attachments

Description Maarten Dammers 2014-05-30 09:30:22 UTC
Bot tries to parse https://www.wikidata.org/wiki/Q156578 (api: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q156578&props=claims).

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'>
Comment 1 xqt 2014-05-30 10:53:35 UTC

*** This bug has been marked as a duplicate of bug 65758 ***

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


Navigation
Links