Closed ladyada closed 2 years ago
I've just tried this with a fresh install of msys2
uname -a
=> MSYS_NT-10.0-19042 dolores 3.2.0-340.x86_64 2021-05-24 19:32 UTC x86_64 Msys
and it runs without error:
$ cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
You've downloaded /home/PC/.cookiecutters/cookiecutter-adafruit-circuitpython before. Is it okay to delete and re-download it? [yes]:
Select target_bundle:
1 - Adafruit
2 - Community
Choose from 1, 2 [1]:
github_user [adafruit]:
author_name: ladyada
company [Adafruit Industries]:
library_name: NeoKey
library_description []: Python library for seesaw-based NeoKey boards
library_keywords []: python circuitpython neopixel seesaw mechanical keyboard
library_prefix [adafruit]:
adafruit_pid []: 4980
requires_bus_device []:
requires_register []:
other_requirements []: adafruit-circuitpython-seesaw
pypi_release [yes]:
sphinx_docs [yes]:
python --version
=> Python 3.9.5
The unexpected char '\uf07c' is technically in the Private Use Area range : https://www.unicode.org/charts/PDF/UE000.pdf
I've seen it listed as folder-open
in a Font : https://fontawesome.com/v5.15/icons/folder-open?style=solid
Can you try again with an upgraded msys2 and see if it still gives an error?
The unexpected char '\uf07c' is technically in the Private Use Area range : https://www.unicode.org/charts/PDF/UE000.pdf I've seen it listed as
folder-open
in a Font : https://fontawesome.com/v5.15/icons/folder-open?style=solid
While reading through other issues, I've found the source of the '\uf07c'
Somehow the pipe character in the filename (not the best idea probably) somehow gets read as \uf07c which then of course is not correctly parsed.
Ref: https://github.com/cookiecutter/cookiecutter/issues/943
I am running to similar issue on windows as well, any solution found yet?
result = generate_files(
File "c:\users\milador\appdata\local\programs\python\python39\lib\site-packages\cookiecutter\generate.py", line 272, in generate_files
project_dir, output_directory_created = render_and_create_dir(
File "c:\users\milador\appdata\local\programs\python\python39\lib\site-packages\cookiecutter\generate.py", line 190, in render_and_create_dir
name_tmpl = environment.from_string(dirname)
File "c:\users\milador\appdata\local\programs\python\python39\lib\site-packages\jinja2\environment.py", line 1092, in from_string
return cls.from_code(self, self.compile(source), gs, None)
File "c:\users\milador\appdata\local\programs\python\python39\lib\site-packages\jinja2\environment.py", line 757, in compile
self.handle_exception(source=source_hint)
File "c:\users\milador\appdata\local\programs\python\python39\lib\site-packages\jinja2\environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<unknown>", line 1, in template
jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got 'C'
The other issue I found was https://github.com/cookiecutter/cookiecutter/issues/1632 and https://github.com/cookiecutter/cookiecutter/issues/1636
One option we have is to switch to ansys-cookiecutter, fix any problems that arise due to the 2.x major version bump, and change our templates to use the workaround.
In any case, our CI should include "test that the cookie cutter works on Windows".
To try out the fix in #177:
pip install cookiecutter@https://github.com/cookiecutter/cookiecutter/archive/2.0.2.zip
or pip install ansys-cookiecutter
cookiecutter https://github.com/jepler/cookiecutter-adafruit-circuitpython/archive/refs/heads/ansys-cookiecutter.zip