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

MNT: remove deprecated mktemp from add-archive-content #6428

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

adswa
Copy link
Member

@adswa adswa commented Feb 7, 2022

This function bears a potential security risk and has been deprecated
since Python version 2.3. This change replaces its use with mkdtemp,
which creates a temporary directory in a more secure manner

As mkdtemp does not clean the temporary directory up afterwards, this
change also adds a removal of any leftover empty temporary directories.

Changelog

🏠 Internal

  • add-archive-content does not rely on the deprecated tempfile.mktemp anymore, but uses the more secure tempfile.mkdtemp

This function bears a potential security risk and has been deprecated
since Python version 2.3. This change replaces its use with mkdtemp,
which creates a temporary directory in a more secure manner

As mkdtemp does not clean the temporary directory up afterwards, this
change also adds a removal of any leftover empty temporary directories.
@adswa adswa added the semver-internal Changes only affect the internal API label Feb 7, 2022
@codeclimate
Copy link

codeclimate bot commented Feb 7, 2022

Code Climate has analyzed commit 157db55 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

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

I somehow feel the urge to put this in a try-finally, but no such protection existed before, so this should still be a net improvement. Thx!

All test failures are unrelated.

@yarikoptic yarikoptic merged commit 70109cc into datalad:master Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-internal Changes only affect the internal API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants