Topic on Project:Support desk

Quinnj09 (talkcontribs)

I cannot get pygmentize for Extension:SyntaxHighlight to work, in mediawiki debug log I get:

[exec] Error running "c:\Python27\Scripts\pygmentize.exe" "-l" "sql" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8": 'c:\Python27\Scripts\pygmentize.exe" "-l" "sql" "-f" "html" "-O" "cssclass' is not recognized as an internal or external command, operable program or batch file.

Has anyone got any suggestions for next steps?

MarkAHershberger (talkcontribs)

Does running the command from your command prompt work?

In other words, what happens when you copy and paste the the following to a prompt?

c:\Python27\Scripts\pygmentize.exe -l sql -f html -O cssclass=mw-highlight,encoding=utf-8
Quinnj09 (talkcontribs)
MarkAHershberger (talkcontribs)

What happens if you use

c:\Python27\Scripts\pygmentize.exe -l sql -f html -O cssclass=mw-highlight,encoding=utf-8 < NUL

or just press Ctrl-Z after the command hangs?

MarkAHershberger (talkcontribs)

If the command returns, that indicates that it is waiting for input on STDIN.

Quinnj09 (talkcontribs)

Ctrl-Z isn't a suitable command, think you mean Ctrl-C, which returns:

Traceback (most recent call last):

  File "C:\Python27\Lib\runpy.py", line 174, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "C:\Python27\Lib\runpy.py", line 72, in _run_code

    exec code in run_globals

  File "c:\Python27\Scripts\pygmentize.exe\__main__.py", line 9, in <module>

  File "C:\Python27\lib\site-packages\pygments\cmdline.py", line 543, in main

    return main_inner(popts, args, usage)

  File "C:\Python27\lib\site-packages\pygments\cmdline.py", line 402, in main_inner

    code = sys.stdin.read()

Running the second command with < Nul gives me:

<div class="mw-highlight"><pre><span></span>

</pre></div>

MarkAHershberger (talkcontribs)

No, I mean Ctrl-Z which in MS OS is like Ctrl-D on Unix. But it looks like you need Ctrl-Z and then return, not just Ctrl-Z by itself.

Anyway, this shows that it is set up to read from STDIN and MediaWiki isn't set up to send the input in the MS world in the correct way. I think the bug you found is the right place to put this information.

Quinnj09 (talkcontribs)

Yeh it is that bug, and I've tried the 'workaround', but like @Daimona Eaytoy found, isn't a complete solution, as another problem pops out: the process starts running, but never stops