Last modified: 2014-10-17 00:32:07 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 T73095, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71095 - newitem.py broken after page.py update
newitem.py broken after page.py update
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
core-(2.0)
All All
: Highest major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-20 21:08 UTC by Maarten Dammers
Modified: 2014-10-17 00:32 UTC (History)
4 users (show)

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


Attachments

Description Maarten Dammers 2014-09-20 21:08:39 UTC
I just updated to the latest git version and now newitem.py stopped working:

>>> HSM Salamander - Phoenix <<<
Traceback (most recent call last):
  File "C:\pywikibot\coredev\pwb.py", line 164, in <module>
    run_python_file(fn, argv, argvu)
  File "C:\pywikibot\coredev\pwb.py", line 69, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "C:\pywikibot\coredev\scripts\newitem.py", line 141, in <module>
    main()
  File "C:\pywikibot\coredev\scripts\newitem.py", line 138, in main
    bot.run()
  File "C:\pywikibot\coredev\scripts\newitem.py", line 68, in run
    item = pywikibot.ItemPage.fromPage(page)
  File "C:\pywikibot\coredev\pywikibot\page.py", line 3156, in fromPage
    raise pywikibot.NoPage(i)
pywikibot.exceptions.NoPage: Page [[wikidata:-1]] doesn't exist.
<class 'pywikibot.exceptions.NoPage'>

The behaviour of Page.fromPage was changed:
https://git.wikimedia.org/blobdiff/pywikibot%2Fcore.git/431cb776cbdf0196b5498a98ea805e81acdf08bb/pywikibot%2Fpage.py

Forgot to test downstream usage?
Comment 1 Maarten Dammers 2014-09-20 21:22:28 UTC
Looking at the code I'm afraid claimit.py and harvest_template.py are broken too because of this.
Comment 2 Gerrit Notification Bot 2014-09-20 21:26:16 UTC
Change 161222 had a related patch set uploaded by John Vandenberg:
Implement item-centric WikidataBot.run

https://gerrit.wikimedia.org/r/161222
Comment 3 Gerrit Notification Bot 2014-09-20 22:28:47 UTC
Change 161759 had a related patch set uploaded by John Vandenberg:
FIX newitem.py to instantiate a new item

https://gerrit.wikimedia.org/r/161759
Comment 4 JAn Dudík 2014-09-21 21:16:15 UTC
With patch (161222) it works, but there is also one more bug:
When page is created and after moved to new name without leaving redirect, bot crashes.

pbb.py -newitem -namespace:0 -lang:cs
...

>>> Viktorin Pohl (rozcestník) <<<
ERROR: Page [[cs:Viktorin Pohl (rozcestník)]] doesn't exist.
Traceback (most recent call last):
  File "I:\py\rewrite\pywikibot\bot.py", line 1006, in run
    self.treat(page, item)
  File "I:\py\rewrite\scripts\newitem.py", line 76, in treat
    if page.editTime() > self.lastEditBefore:
  File "I:\py\rewrite\pywikibot\page.py", line 533, in editTime
    rev = self.latestRevision()
  File "I:\py\rewrite\pywikibot\page.py", line 396, in latestRevision
    self.site.loadrevisions(self)
  File "I:\py\rewrite\pywikibot\site.py", line 2860, in loadrevisions
    raise NoPage(page)
NoPage: Page [[cs:Viktorin Pohl (rozcestnĂ­k)]] doesn't exist.
I:\py\rewrite>
Comment 5 Gerrit Notification Bot 2014-09-22 00:04:12 UTC
Change 161759 merged by jenkins-bot:
Fix newitem.py to instantiate a new item

https://gerrit.wikimedia.org/r/161759
Comment 6 Maarten Dammers 2014-10-14 19:35:18 UTC
Fixed now?
Comment 7 John Mark Vandenberg 2014-10-15 00:32:27 UTC
Yup

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


Navigation
Links