Last modified: 2014-07-24 07:59:33 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 T56548, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54548 - _getUserDataOld call from low-level getUrl
_getUserDataOld call from low-level getUrl
Status: NEW
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: Low minor
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-24 22:29 UTC by Kunal Mehta (Legoktm)
Modified: 2014-07-24 07:59 UTC (History)
3 users (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2013-09-24 22:29:33 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/patches/608/
Reported by: valhallasw
Created on: 2013-04-13 20:51:59
Subject: _getUserDataOld call from low-level getUrl
Original description:
From http://lists.wikimedia.org/pipermail/pywikipedia-l/2012-October/007585.html :

I just wanted to put\(\) a simple page on a MediaWiki 1.16
instance, where I have to use screen scraping \(use\_api=False\).

There is something strange however:

There is an API call invoked by \_getBlocked:

/w/api.php?action=query&format=json&meta=userinfo&uiprop=blockinfo

Here's my backtrace:

File "pywikipedia/wikipedia.py", line 693, in get
expandtemplates = expandtemplates\)

File "pywikipedia/wikipedia.py", line 743, in \_getEditPage
return self.\_getEditPageOld\(get\_redirect, throttle, sysop, oldid, change\_edit\_time\)

File "pywikipedia/wikipedia.py", line 854, in \_getEditPageOld
text = self.site\(\).getUrl\(path, sysop = sysop\)

File "pywikipedia/wikipedia.py", line 5881, in getUrl
self.\_getUserDataOld\(text, sysop = sysop\)

File "pywikipedia/wikipedia.py", line 6016, in \_getUserDataOld
blocked = self.\_getBlock\(sysop = sysop\)

File "pywikipedia/wikipedia.py", line 5424, in \_getBlock
data = query.GetData\(params, self\)

File "pywikipedia/query.py", line 146, in GetData
jsontext = site.getUrl\( path, retry=True, sysop=sysop, data=data\)


getUrl\(\), which is also called from API, seems always
to call \_getUserDataOld\(text\) where text is ... API output 
so it tries to do strange things on that and gives warnings
like 

Note: this language does not allow global bots.
WARNING: Token not found on wikipedia:pl. You will not be able to edit any page.

which is nonsense since the analyzed text is not HTML - only API output.

If getUrl\(\) is supposed to be a low-level call, why call \_getUserDataOld\(\)
there?

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/7461 

has introduced this call there.

It's easily reproducable by this:

import wikipedia
import config
config.use\_api = False
wikipedia.verbose = True
s = wikipedia.getSite\("pl", "wikipedia"\)
p = wikipedia.Page\(s, u"User:Saper"\)
c = p.get\(\)
c += "<\!-- test -->"
p.put\(c, u"Testing wiki", botflag=False\)

//Saper
Comment 1 Amir Ladsgroup 2014-07-24 07:59:33 UTC
reproduced, since it's in compat I set priority to minor

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


Navigation
Links