TST: remove insecure mktemp use in tests #3289

Merged
merged 1 commit into from Feb 8, 2014

Projects

None yet

4 participants

@juliantaylor
Contributor

mktemp only returns a filename, a malicous user could replace it before
it gets used.

@coveralls

Coverage Status

Changes Unknown when pulling 54bd782 on juliantaylor:mktemp-remove into * on scipy:master*.

@pv pv commented on an outdated diff Feb 7, 2014
scipy/io/tests/test_mmio.py
@@ -11,10 +11,15 @@
class TestMMIOArray(TestCase):
+ def setUp(self):
+ self.f = NamedTemporaryFile(suffix=".mtx")
@pv
pv Feb 7, 2014 Member

I suspect overwriting an open file will cause failures on Windows.
Using mkdtemp would seem a more portable option.

@juliantaylor juliantaylor TST: remove insecure mktemp use in tests
mktemp only returns a filename, a malicous user could replace it before
it gets used.
4fb5abf
@juliantaylor
Contributor

used a tmpdir for mmio test and backed out the weave changes in favor of adding them to @rgommers weave test cleanup PR rgommers#8

@pv pv merged commit 1f9f36d into scipy:master Feb 8, 2014

1 check was pending

Details default The Travis CI build is in progress
@pv
Member
pv commented Feb 8, 2014

Thanks, looks good to me.

@coveralls

Coverage Status

Coverage remained the same when pulling 4fb5abf on juliantaylor:mktemp-remove into 63f951e on scipy:master.

@rgommers rgommers added this to the 0.14.0 milestone Feb 16, 2014
@juliantaylor juliantaylor deleted the juliantaylor:mktemp-remove branch Aug 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment