Pidgeot / python-lnp

Cross-platform re-implementation of the Lazy Newb Pack launcher.
ISC License
64 stars 10 forks source link

lnp.py crashes on windows if path contains non-ascii characters #167

Closed utunnels closed 4 years ago

utunnels commented 4 years ago
F:\测试>python launch.py
Traceback (most recent call last):
  File "launch.py", line 12, in <module>
    lnp.PyLNP()
  File "F:\测试\core\lnp.py", line 99, in __init__
    os.chdir(os.path.join(os.path.dirname(__file__), '..'))
  File "C:\Users\Administrator\.windows-build-tools\python27\lib\ntpath.py", lin
e 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 1: ordinal
not in range(128)

Suggest fix: __file__=unicode(__file__,sys.getfilesystemencoding())

cryzed commented 4 years ago

Most likely related to you running with Python 2 instead of Python 3.

Pidgeot commented 4 years ago

This should be fixed with v0.14, as these builds now use Python 3.