TannerRogalsky / love.js

LÖVE ported to the web using Emscripten
MIT License
493 stars 53 forks source link

Non-ASCII characters in file paths don't work on windows #14

Closed JanWerder closed 8 years ago

JanWerder commented 8 years ago

I'm trying to compile my Löve game under Windows 10 with Python 2.7

python ../emscripten/tools/file_packager.py game.data --preload C:\Users\janwe\Documents\GitHub\game@/ --js-output=game.js

Gives me the following error:

C:\Users\janwe\nak\lovejs\love.js\debug>python ../emscripten/tools/file_packager.py game.data --preload C:\Users\janwe\Documents\GitHub\game\@/ --js-output=game.js Traceback (most recent call last): File "../emscripten/tools/filepackager.py", line 255, in os.path.walk(file['srcpath'], add, [file['mode'], file['srcpath'], file_['dstpath']]) File "C:\Python27\lib\ntpath.py", line 273, in walk walk(name, func, arg) File "C:\Python27\lib\ntpath.py", line 273, in walk walk(name, func, arg) File "C:\Python27\lib\ntpath.py", line 269, in walk func(arg, top, names) File "../emscripten/tools/file_packager.py", line 240, in add if should_ignore(fullname): File "../emscripten/tools/file_packager.py", line 219, in should_ignore if has_hidden_attribute(fullname): File "../emscripten/tools/file_packager.py", line 209, in has_hidden_attribute attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(filepath)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 74: ordinal not in range(128)

C:\Users\janwe\nak\lovejs\love.js\debug>

TannerRogalsky commented 8 years ago

@JanWerder Does one of your files or directories have a non-ascii character in it's file path? Non-ascii characters in file paths on windows seems to cause problems.

JanWerder commented 8 years ago

This was indeed the error. I had a library called sölar and renaming it to solar resolved this issue

TannerRogalsky commented 8 years ago

If someone really desperately wants to use non-ASCII characters in their filenames on Windows, consider resolving this issue: https://github.com/kripken/emscripten/pull/4102

JanWerder commented 8 years ago

Thank you for finding the root cause :)