Closed
Description
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of pandas.
- (optional) I have confirmed this bug exists on the master branch of pandas.
The unit test at pandas/tests/io/test_common.py
produces a file using a hardcoded name as shown below:
filename = path_type("~/sometest")
with icom.get_handle(filename, "w") as handles:
assert os.path.isabs(handles.handle.name)
assert os.path.expanduser(filename) == handles.handle.name
Problem description
A developer may encounter an empty file "sometest" appearing in their home directory (after running pytest
). If the developer is unaware of that, then it may raise some wrong security concerns on their side. Also, in the extreme scenario that the developer has a file at the exact same path, then its content may be replaced.
Expected Output
I would expect the file produced by the unit test to be temporary and get deleted afterwards. Also, that the filename is generated rather than hardcoded.