https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
Bug ID: 66330 Summary: Running page_tests.py causes python to crash Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: documentation Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: Phoenixoverride@gmail.com Web browser: --- Mobile Platform: ---
Running tests/page_tests.py under windows causes python.exe to crash. Suspect it is due to having mwparserfromhell installed, but not being able to use the mwparserfromhell.parser.use_c which I manually have to set to false to ensure that python doesn't crash, will investigate and provide followup
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #1 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 138209 had a related patch set uploaded by Gerrit Patch Uploader: fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330
https://gerrit.wikimedia.org/r/138209
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #2 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 138210 had a related patch set uploaded by Gerrit Patch Uploader: fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330
https://gerrit.wikimedia.org/r/138210
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #3 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 138211 had a related patch set uploaded by Gerrit Patch Uploader: fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330
https://gerrit.wikimedia.org/r/138211
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 138211 abandoned by John Vandenberg: fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330
Reason: Dup of Id1bafc078f924a4cc52bfe165b9639af9d4145d
https://gerrit.wikimedia.org/r/138211
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com
--- Comment #5 from John Mark Vandenberg jayvdb@gmail.com --- Do all test case in tests/page_tests.py fail? Can you attach a log of the unit test?
In the gerrit code review https://gerrit.wikimedia.org/r/#/c/138209/, it was explained that the issue upstream was closed without resolution: https://github.com/earwig/mwparserfromhell/issues/54
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #6 from Betacommand Phoenixoverride@gmail.com --- C:\rewrite>pwb.py tests\page_tests.py --v testHashCmp (__main__.TestLinkObject) ... ok testNamespaces (__main__.TestLinkObject) Test that Link() normalizes namespace names ... ok testTitles (__main__.TestLinkObject) Test that Link() normalizes titles ... ok testApiMethods (__main__.TestPageObject) Test various methods that rely on API. ...
is all I get
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |info@gno.de
--- Comment #7 from xqt info@gno.de --- I am running on windows environment without mwpfh installed. It's result is:
c:\Pywikipedia\ssh\pywikibot\core>pwb.py tests/page_tests -v testHashCmp (__main__.TestLinkObject) ... ok testNamespaces (__main__.TestLinkObject) Test that Link() normalizes namespace names ... ok testTitles (__main__.TestLinkObject) Test that Link() normalizes titles ... ok testApiMethods (__main__.TestPageObject) Test various methods that rely on API. ... ok testGeneral (__main__.TestPageObject) ... ok testIsCategory (__main__.TestPageObject) Test isCategory method. ... ok testIsDisambig (__main__.TestPageObject) ... ok testIsImage (__main__.TestPageObject) ... ok testIsRedirect (__main__.TestPageObject) ... ok testIsTalkPage (__main__.TestPageObject) Test isTalkPage() method. ... ok testLinks (__main__.TestPageObject) ... ok testNamespace (__main__.TestPageObject) Test namespace() method ... ok testPageGet (__main__.TestPageObject) ... ok testReferences (__main__.TestPageObject) ... ok testSection (__main__.TestPageObject) Test section() method. ... ok testSite (__main__.TestPageObject) Test site() method ... ok testTitle (__main__.TestPageObject) Test title() method options. ... ok
---------------------------------------------------------------------- Ran 17 tests in 2.806s
OK
c:\Pywikipedia\ssh\pywikibot\core>
After cleaning the api-cache I got the same exept it needs some more time:
Ran 17 tests in 32.706s
OK
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |WORKSFORME
--- Comment #8 from John Mark Vandenberg jayvdb@gmail.com --- I have installed mwparserfromhell using pip, resulting in 0.3.3, and mwparserfromhell.parser.use_c being True by default.
When I run textlib_tests and page_tests, they run correctly on a 32bit system.
I suspect that there was a problem with the mwparserfromhell build, either upstream or a local build issue.
Recommend reinstalling again via pip, to be sure.
If the problem still exists, run the tests with full debug/verbose logging as shown in https://gerrit.wikimedia.org/r/#/c/146046/ , then remove the password from the log and upload it as an attachment to bugzilla, re-open the bug, and specify whether you have 64bit or 32bit machine.
https://bugzilla.wikimedia.org/show_bug.cgi?id=66330
--- Comment #9 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 138210 abandoned by John Vandenberg: fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330
Reason: Cant reproduce the problem, and if there is still a problem it needs to be fixed in mwparserfromhell.
https://gerrit.wikimedia.org/r/138210
pywikipedia-bugs@lists.wikimedia.org