0
votes

I have installed Python 3.3 on Windows 7 and created a bat file to run the Python script below:

set calc="C:/projects/libraries/closure-library/closure/bin/build/closurebuilder.py"
c:/Python33/python.exe %calc% ^
--root=C:/projects/libraries/closure-library/ ^
--root=C:/projects/mywebsite/assets/js/ ^
--input=C:/projects/mywebsite/assets/js/start.js ^
--output_mode=list ^
--output_file=C:/projects/mywebsite/assets/js/deps.js
pause

When I double click on the bat file I get the error below:

File "C:\Python33\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 6586: character maps to

1
Finish your question.martineau

1 Answers

1
votes

There was an issue with one of the Google Closure Library Python files (/closure/bin/build/source.py) The fix was to specify the encoding when opening the file:

fileobj = open(path, encoding='utf-8')

More info about how to fix the issue is at https://code.google.com/p/closure-library/issues/detail?id=603