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: Always use absolute path to temp folders #599

Merged

Conversation

sassdavid
Copy link
Contributor

@sassdavid sassdavid commented Jul 24, 2024

Description

Fixes #592.

Since Python 3.12 changed the default behavior of tempfile.mkdtemp(suffix=None, prefix=None, dir=None) (see the documentation here) and based on the discussion in the issue, it is recommended to use absolute paths for temporary folders. This pull request addresses that for earlier Python versions.

From now on, the method in the package.py will return an absolute path.

Motivation and Context

The details are described in issue #592.

Breaking Changes

Since this is the proposed solution and all the examples use absolute paths for the temporary folders, it is presumably not a breaking change.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@sassdavid sassdavid changed the title improvement: always use absolute path to temp folders fix: always use absolute path to temp folders Jul 24, 2024
@sassdavid sassdavid force-pushed the improvement/tempdir branch from 6b0c184 to 27585a5 Compare July 24, 2024 12:45
@sassdavid sassdavid force-pushed the improvement/tempdir branch from 27585a5 to 89d980d Compare July 24, 2024 12:47
@sassdavid sassdavid changed the title fix: always use absolute path to temp folders fix: Always use absolute path to temp folders Jul 24, 2024
@pdecat pdecat self-assigned this Jul 24, 2024
Copy link
Contributor

@pdecat pdecat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@antonbabenko antonbabenko merged commit a058372 into terraform-aws-modules:master Jul 25, 2024
30 of 31 checks passed
antonbabenko pushed a commit that referenced this pull request Jul 25, 2024
## [7.7.1](v7.7.0...v7.7.1) (2024-07-25)

### Bug Fixes

* Always use absolute path to temp folders ([#599](#599)) ([a058372](a058372))
@antonbabenko
Copy link
Member

This PR is included in version 7.7.1 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default behavior of tempfile.mkdtemp(suffix=None, prefix=None, dir=None) changed in Python 3.12
3 participants