Page MenuHomePhabricator

Syntaxhighlight fails to run on Windows and fails with a python error.
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
Python doesn't start correctly and generates this message: Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Python runtime state: preinitialized

What should have happened instead?:
Should be possible to run Python. A possible cause is described here. (the OS environment carrying the original environment is missing from the subprocess?

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
MediaWiki 1.37.0

Event Timeline

Adding

->environment( [ 'SYSTEMROOT' => 'C:\Windows', ])

under each self::boxedCommand in includes/pygmentize.php seems to have fixed the problem for me. It had to be added 4 times at (roughly) line 79, 135, 173, and 227, before the "->execute();" and after the "->params()."

Change 852324 had a related patch set uploaded (by Skizzerz; author: Skizzerz):

[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852324

Change 852324 merged by jenkins-bot:

[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852324

Change 852178 had a related patch set uploaded (by Reedy; author: Skizzerz):

[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_39] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852178

Change 852179 had a related patch set uploaded (by Reedy; author: Skizzerz):

[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_38] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852179

Change 852179 merged by jenkins-bot:

[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_38] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852179

Change 852178 merged by jenkins-bot:

[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_39] Fix pygments on Windows

https://gerrit.wikimedia.org/r/852178

TheDJ assigned this task to Skizzerz.
TheDJ added a subscriber: Skizzerz.

Thank you @Skizzerz !!!