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

Python 3.12 tempfile.mkdtemp() change impacts --flat behavior #58

Open
cho-m opened this issue Oct 15, 2024 · 1 comment · May be fixed by #59
Open

Python 3.12 tempfile.mkdtemp() change impacts --flat behavior #58

cho-m opened this issue Oct 15, 2024 · 1 comment · May be fixed by #59

Comments

@cho-m
Copy link

cho-m commented Oct 15, 2024

In Python 3.12 or later, dtrx --flat no longer behaves as expected which appears to be due to tempfile.mkdtemp() change:

Changed in version 3.12: mkdtemp() now always returns an absolute path, even if dir is relative.

One workaround could be to restore Python 3.11 output with something like os.path.join(".", os.path.relpath( ... )).

Alternatively may want to fix code so that absolute paths are handled correctly.

Should be easily reproducible by using Python 3.12 or 3.13 and then doing a simple test like

touch test1 test2 test3
zip test.zip test1 test2 test3
rm test1 test2 test3
dtrx --flat test.zip

Seen in Homebrew a while back when trying to update dtrx to Python 3.12 since testcase runs dtrx --flat test.zip, e.g. Homebrew/homebrew-core#151052

Probably impacts package on Linux distros that are using Python 3.12 (many rolling release) or 3.13 (e.g. Fedora 41+). For example, Alpine uses Python 3.12 as dependency for dtrx https://pkgs.alpinelinux.org/package/edge/community/x86_64/dtrx

@ChrisJefferson
Copy link

Thanks for reporting this. I'm working on it.

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

Successfully merging a pull request may close this issue.

2 participants