Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest-cookies fails on Windows (YAML config erroneous) #62

Closed
pakal opened this issue Jun 15, 2022 · 5 comments
Closed

Pytest-cookies fails on Windows (YAML config erroneous) #62

pakal opened this issue Jun 15, 2022 · 5 comments

Comments

@pakal
Copy link

pakal commented Jun 15, 2022

The YAML config is built by simple string formatting in https://github.com/hackebrot/pytest-cookies/blob/master/src/pytest_cookies/plugin.py

But since on Windows, filepaths use backslashes, this makes an invalid YAML file with wrong escape sequences :

while scanning a double-quoted scalar
  in "C:\Users\Pascal\AppData\Local\Temp\pytest-of-Pascal\pytest-67\user_dir0\config", line 2, column 20
expected escape sequence of 8 hexadecimal numbers, but found 's'
  in "C:\Users\Pascal\AppData\Local\Temp\pytest-of-Pascal\pytest-67\user_dir0\config", line 2, column 25

So this config should be dumped with a proper YAML parser.

For some reason, all works with old cookiecutter==1.7.2, probably the parser it uses is different

@jamesmyatt
Copy link
Contributor

Simplest solution that avoids adding dependencies is to dump the config as JSON, since YAML is a superset of JSON.

@jamesmyatt
Copy link
Contributor

I think this is an issue with poyo, which is used by cookiecutter < 2.

@mmerickel
Copy link

I'm experiencing this as well when running the pyramid-cookiecutter-starter tests on windows. Is there a workaround I can use?

@jamesmyatt
Copy link
Contributor

Try my fork as described in #41

@mmerickel
Copy link

Thanks, the fork is working for me. The failure versus the success with the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants