Skip to content

Commit 6e9651e

Browse files
jbrockmendelsimonjayhawkins
authored andcommitted
BUG: pickle files left behind by tm.round_trip_pickle (pandas-dev#30906)
1 parent f887eb0 commit 6e9651e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/_testing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ def round_trip_pickle(
122122
_path = path
123123
if _path is None:
124124
_path = f"__{rands(10)}__.pickle"
125-
with ensure_clean(_path) as path:
126-
pd.to_pickle(obj, _path)
127-
return pd.read_pickle(_path)
125+
with ensure_clean(_path) as temp_path:
126+
pd.to_pickle(obj, temp_path)
127+
return pd.read_pickle(temp_path)
128128

129129

130130
def round_trip_pathlib(writer, reader, path: Optional[str] = None):

0 commit comments

Comments
 (0)