windows preview bug fix

Idan Pazi idan.kp at gmail.com
Fri Feb 16 13:23:24 UTC 2024


Encountered the following bug (windows 10, python 3.12) - preview of math
fails:

 graphics\PreviewLoader.cpp (2ef): PreviewLoader::finishedInProgress(1):
processing failed for py -3 -tt $$s/scripts/lyxpreview2bitmap.py --png
"C:/Users/idank/AppData/Local/Temp/lyx_tmpdir.mzhGYGTpQcAc/lyx_tmpbuf0/lyxpreviewuaCFJC.tex"
--dpi 137 --fg 000000 --bg ffffff --bibtex="bibtex"


Running the command manually gives the problem:

  File "C:\Program Files\LyX 2.4\Resources\scripts\lyxpreview_tools.py",
line 168, in run_command_win32
    data = data + buffer
           ~~~~~^~~~~~~~
TypeError: can only concatenate str (not "bytes") to str


Apparently, the returned value from win32file.ReadFile
<https://timgolden.me.uk/pywin32-docs/win32file__ReadFile_meth.html> should
be converted to a string.
Fix patch attached.
Thank you, Idan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240216/26619e01/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-returned-value-of-win32file.ReadFile.patch
Type: application/octet-stream
Size: 929 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240216/26619e01/attachment.obj>


More information about the lyx-devel mailing list