erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.7k stars 55 forks source link

Add Python Path for Windows #533

Open GreasySlug opened 3 weeks ago

GreasySlug commented 3 weeks ago

Changes proposed in this PR:

@mtshiba

mtshiba commented 2 weeks ago

I looked into the cause of the test error, and it seems that it may not be a problem with the Python interpreter selection. When I ran cargo test without workaround on Windows, I got the following result.

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "examples/helloworld.er", line -1, in <module>
UnicodeEncodeError: 'cp932' codec can't encode character '\u03ac' in position 3: illegal multibyte sequence

I don't remember seeing this error when I wrote this test, but this output may have been obtained as a result of several improvements to make the test results readable.

\u03ac is the Greek letter ά. Indeed, this character is included in the source code. In this test, I wanted to check whether Erg can support multilingual source code, but there may be a codec problem on Windows.

In fact, the test passed when I deleted everything except alphabets and hiragana.