Thanks for you suggestion, I tried to remove the Colon and write myself, And still get the same error massgae.
I think it would be batter for me paste the code here to see if anyone have same error:
Same issue here, but the proposed solution didn’t work.
Using Win10, conda. With notepad++ I create the YAML file, change end of line to unix (LF) and save it, but still getting the same message when running lumen serve penguins.yaml --show --autoreload
Same trace with CRLF, CR or LF end of lines (at least using Notepad++):
ERROR: Error loading penguins.yaml:
Invalid syntax in 'penguins.yaml' on line 1:
sources:
Traceback (most recent call last):
File "C:\Users\rrr\miniconda3\lib\site-packages\bokeh\application\handlers\code_runner.py", line 106, in __init__
nodes = ast.parse(source, os.fspath(path))
File "C:\Users\rrr\miniconda3\lib\ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "penguins.yaml", line 1
sources:
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escapeThis text will be hidden
Yes, I did check that the character is actually changing to LF, even it could be seen in plain Notepad.
I have tried debugging and have been able to fix it. It seems that YamlHanlder generates a path in Windows mode using backslashes. Forcing the path to be posix in this line of this file works: filename = Path(os.path.abspath(kwargs['filename'])).as_posix()
Thanks again and I hope it can be helpful to anyone who has the same problem.