Last modified: 2014-09-18 08:58:55 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 T72978, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70978 - win32 py3 sub error
win32 py3 sub error
Status: RESOLVED DUPLICATE of bug 69664
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: pwbpy3
  Show dependency treegraph
 
Reported: 2014-09-18 00:04 UTC by John Mark Vandenberg
Modified: 2014-09-18 08:58 UTC (History)
1 user (show)

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


Attachments

Description John Mark Vandenberg 2014-09-18 00:04:22 UTC
An error that only happens on py3

======================================================================
ERROR: test_item_templates (tests.wikibase_tests.TestPageMethods)
Test templatesWithParams.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\pywiki\core\tests\wikibase_tests.py", line 511, in test_item_templa
tes
    self.wdp.templatesWithParams()
  File "c:\pywiki\core\pywikibot\tools.py", line 317, in wrapper
    return method(*__args, **__kw)
  File "c:\pywiki\core\pywikibot\page.py", line 1267, in templatesWithParams
    templates = textlib.extract_templates_and_params(self.text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 924, in extract_templates_a
nd_params
    return extract_templates_and_params_regex(text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 951, in extract_templates_a
nd_params_regex
    thistxt = removeDisabledParts(text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 294, in removeDisabledParts

    return toRemoveR.sub('', text)
TypeError: expected string or buffer

(And that error causes the following error)

======================================================================
ERROR: test_item_bot_may_edit (tests.wikibase_tests.TestPageMethods)
Test botMayEdit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\pywiki\core\tests\wikibase_tests.py", line 521, in test_item_bot_ma
y_edit
    self.assertTrue(item.botMayEdit())
  File "c:\pywiki\core\pywikibot\page.py", line 897, in botMayEdit
    templates = self.templatesWithParams()
  File "c:\pywiki\core\pywikibot\tools.py", line 317, in wrapper
    return method(*__args, **__kw)
  File "c:\pywiki\core\pywikibot\page.py", line 1267, in templatesWithParams
    templates = textlib.extract_templates_and_params(self.text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 924, in extract_templates_a
nd_params
    return extract_templates_and_params_regex(text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 951, in extract_templates_a
nd_params_regex
    thistxt = removeDisabledParts(text)
  File "c:\pywiki\core\pywikibot\textlib.py", line 294, in removeDisabledParts

    return toRemoveR.sub('', text)
TypeError: expected string or buffer
Comment 1 Fabian 2014-09-18 08:39:51 UTC
This happens also on Python 3.4.1 with Linux:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xzise/Programms/core/pywikibot/tools.py", line 317, in wrapper
    return method(*__args, **__kw)
  File "/home/xzise/Programms/core/pywikibot/page.py", line 968, in save
    if not force and not self.botMayEdit():
  File "/home/xzise/Programms/core/pywikibot/page.py", line 897, in botMayEdit
    templates = self.templatesWithParams()
  File "/home/xzise/Programms/core/pywikibot/tools.py", line 317, in wrapper
    return method(*__args, **__kw)
  File "/home/xzise/Programms/core/pywikibot/page.py", line 1267, in templatesWithParams
    templates = textlib.extract_templates_and_params(self.text)
  File "/home/xzise/Programms/core/pywikibot/textlib.py", line 924, in extract_templates_and_params
    return extract_templates_and_params_regex(text)
  File "/home/xzise/Programms/core/pywikibot/textlib.py", line 951, in extract_templates_and_params_regex
    thistxt = removeDisabledParts(text)
  File "/home/xzise/Programms/core/pywikibot/textlib.py", line 294, in removeDisabledParts
    return toRemoveR.sub('', text)
TypeError: expected string or buffer

I suspect they are all the same and only differ depending on the apicache and not on the operating system or Python version.
Comment 2 Fabian 2014-09-18 08:58:55 UTC
This is independent of the Python version, but it's important that mwparsefromhell is not installed, because that doesn't complain abou the text being a dict.

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

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


Navigation
Links