Closed Doormatty closed 2 months ago
That sounds like an issue with Windows encoding. Try to open the resulting Python file with a code editor and updating the encoding to utf8 or latin-1.
I was under the impression that Python 3.X was by default unicode - is that not the case?
python is, but windows cmd is stupid. It defaults to UTF-16, which is not going to work correctly.
Ahh! Thanks! Appreciate the info!
Given the following grammar (and to be clear, I don't think this has anything to do with the grammar itself):
running
python -m lark.tools.standalone .\grammar.txt > standalone.py
Produces the following attached python program (renamed to
standalone.txt
to allow uploading)standalone.txt
With either Python 3.12 and Python 3.11 on Windows 10, any attempt to even include the created file:
from standalone import Lark_StandAlone
throws the exception:SyntaxError: source code string cannot contain null bytes
Thanks so much!