Open cho-m opened 1 week ago
In Python 3.12 or later, dtrx --flat no longer behaves as expected which appears to be due to tempfile.mkdtemp() change:
dtrx --flat
tempfile.mkdtemp()
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( ... )).
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. https://github.com/Homebrew/homebrew-core/pull/151052
dtrx
dtrx --flat test.zip
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
Thanks for reporting this. I'm working on it.
In Python 3.12 or later,
dtrx --flat
no longer behaves as expected which appears to be due totempfile.mkdtemp()
change: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
Seen in Homebrew a while back when trying to update
dtrx
to Python 3.12 since testcase runsdtrx --flat test.zip
, e.g. https://github.com/Homebrew/homebrew-core/pull/151052Probably 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