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

fix(cli): cfn test broken on Windows - NamedTemporaryFile issue #924

Merged
merged 4 commits into from
Nov 1, 2022

Conversation

mmaeng
Copy link
Contributor

@mmaeng mmaeng commented Oct 20, 2022

Closes #876

cfn test fails with Unhandled exception on Windows. This is due to using NamedTemporaryFile which per Python docs does NOT work the same in Windows.

Whether the name can be used to open the file a second time, while the named temporary file is still open,
varies across platforms (it can be so used on Unix; it cannot on Windows).

https://docs.python.org/3.9/library/tempfile.html#tempfile.NamedTemporaryFile

Setting delete=False as workaround.

NOTE - Temporary file must be explicitly cleaned up after temporary_ini_file() is called!

Fix being tracked here python/cpython#58451

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mmaeng mmaeng added bug Something isn't working cli experience p0 High Priority labels Oct 20, 2022
@mmaeng mmaeng self-assigned this Oct 20, 2022
@mmaeng mmaeng merged commit 3491f7a into aws-cloudformation:master Nov 1, 2022
@mmaeng mmaeng deleted the fix/issue876 branch November 1, 2022 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli experience p0 High Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled Exception with cfn test - Permission error with pytest ini file
3 participants