[Bug Report] Encoding Problem on Windows 10 while Reconfiguring

Dai Longzhi 戴龙至 dailongzhi at foxmail.com
Sun Sep 17 03:48:44 UTC 2023


Bacis Info & Reproduce:

      System: Windows 10 22H2 64-bit System Language is Chinese (Simplified)


      Lyx:  Fresh new installed LyX Version 2.3.7 with Texlive full-installed

      Path to Install: C:\Program Files\LyX 2.3\       # (Non-Chinese Path)





Debug message:
11:09:54.257: (buffer-new: Ctrl+N)



11:09:59.180: Running configure...

11:09:59.248: python -tt "C:/Program Files/LyX 2.3/Resources/configure.py" --binary-dir="C:/Program Files/LyX 2.3/bin/"

11:09:59.838: checking for DVI to DTL converter...

11:09:59.839: +checking for "dv2dt"...  yes

11:09:59.839: checking for DTL to DVI converter...

11:09:59.839: +checking for "dt2dv"...  yes

11:09:59.839: checking for a Latex2e program...

11:09:59.840: +checking for "latex"...  yes

11:09:59.840: checking for a DVI postprocessing program...

11:09:59.840: +checking for "pplatex"...  no

11:09:59.840: checking for pLaTeX, the Japanese LaTeX...

11:09:59.841: +checking for "platex"...  yes

11:09:59.841: Traceback (most recent call last):

11:09:59.841:   File "C:/Program Files/LyX 2.3/Resources/configure.py", line 1955, in <module>

11:09:59.841:     LATEX = checkLatex(dtl_tools)

11:09:59.842:   File "C:/Program Files/LyX 2.3/Resources/configure.py", line 589, in checkLatex

11:09:59.842:     if cmdOutput(PLATEX + ' chklatex.ltx').find('pLaTeX2e') != -1:

11:09:59.842:   File "C:/Program Files/LyX 2.3/Resources/configure.py", line 88, in cmdOutput

11:09:59.843:     stdout=subprocess.PIPE, universal_newlines=True)

11:09:59.843:   File "C:\Program Files\LyX 2.3\Python\lib\subprocess.py", line 396, in __init__

11:09:59.843:     errread, errwrite)

11:09:59.844:   File "C:\Program Files\LyX 2.3\Python\lib\subprocess.py", line 646, in _execute_child

11:09:59.844:     startupinfo)

11:09:59.844: UnicodeEncodeError: 'ascii' codec can't encode characters in position 25-27: ordinal not in range(128)

11:09:59.845: Reloading configuration...LyX: reconfiguring user directory

support\Systemcall.cpp (276): Systemcall: 'python -tt "C:/Program Files/LyX 2.3/Resources/configure.py" --binary-dir="C:/Program Files/LyX 2.3/bin/"' finished with exit code 1

LyX: Done!

11:13:22.774: (reconfigure)

11:14:48.054: Automatic save done.

11:19:28.998: (dialog-show aboutlyx)




How to fix:

I found a way in Zhihu.com. It add this: 
import sys
reload(sys)
sys.setdefaultencoding("utf-8")

in "C:\Program Files\LyX 2.3\Python\Lib\subprocess.py". Then the Reconfiguring works.


I am not sure someone will read this. If anyone readed this, please reply to this mail about the progress. Or I will try other way to feedback this bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230917/f306f701/attachment.html>


More information about the lyx-devel mailing list