-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fixed Improper Method Call: Replaced mktemp
#7534
base: maint
Are you sure you want to change the base?
Conversation
appveyor isn't happy with flood of fails like
suggesting that 2nd portion of the patch is to blame... didn't look in detail |
Looking into it. |
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
@@ -259,7 +259,8 @@ def __init__(self, archive, path=None, persistent=False): | |||
self._archive = archive | |||
# TODO: bad location for extracted archive -- use tempfile | |||
if not path: | |||
path = tempfile.mktemp(**get_tempfile_kwargs(prefix=_get_cached_filename(archive))) | |||
fd, path = tempfile.mkstemp(**get_tempfile_kwargs(prefix=_get_cached_filename(archive))) | |||
os.close(fd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more fails remain e.g.
FAILED ../datalad/tests/test_archives.py::test_ExtractedArchive - RuntimeError: Directory /home/appveyor/DLTMP/datalad_temp_e319196a26_htmijjms already exists whenever it should not persist
so there seems to be some side effect remaining... it seems that we need to fixup code... seems can't do suggestion on lines not modified by PR but I think it should be sufficient to bring if
below to be elif
since it makes sense only for cases when path is not specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I'm wondering if
self.path
andself._path
are meant to be the same thing indatalad/support/archives.py
. Because I'm not seeing any code that stores value toself.path
. If it's a typo, then we can refactor the codebase to work with proposedmkstemp()
method. -
The
RunTimeError
is taking place due to the implementation at line 265. It's not related to tests or anything.
Details
While triaging your project, our bug fixing tool generated the following message(s)-
Changes
mktemp()
method withmkstemp()
Previously Found & Fixed
CLA Requirements
This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.
All contributed commits are already automatically signed off.
Sponsorship and Support
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.
CHANGELOG-missing