Page MenuHomePhabricator

Exception on saving an item page
Closed, DuplicatePublic

Description

When I try to save a wikidata item the following exception occurs:

import pywikibot
d = pywikibot.getSite('test', 'wikidata').data_repository()
i = pywikibot.page.ItemPage(d, 'Q6')
i.save()

Traceback (most recent call last):

File "<stdin>", line 1, in <module>
File "pywikibot/tools.py", line 310, in wrapper
  return method(*__args, **__kw)
File "pywikibot/page.py", line 953, in save
  if not force and not self.botMayEdit():
File "pywikibot/page.py", line 882, in botMayEdit
  templates = self.templatesWithParams()
File "pywikibot/tools.py", line 310, in wrapper
  return method(*__args, **__kw)
File "pywikibot/page.py", line 1256, in templatesWithParams
  templates = textlib.extract_templates_and_params(self.text)
File "pywikibot/textlib.py", line 924, in extract_templates_and_params
  return extract_templates_and_params_regex(text)
File "pywikibot/textlib.py", line 944, in extract_templates_and_params_regex
  thistxt = removeDisabledParts(text)
File "pywikibot/textlib.py", line 294, in removeDisabledParts
  return toRemoveR.sub('', text)

TypeError: expected string or buffer

type(i.text)

<type 'dict'>


Version: core-(2.0)
Severity: normal

Details

Reference
bz70241

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:41 AM
bzimport set Reference to bz70241.
bzimport added a subscriber: Unknown Object (????).
  • This bug has been marked as a duplicate of bug 69664 ***