Skip to content

Commit 85ba993

Browse files
meeseeksmachinejbrockmendel
authored andcommitted
Backport PR pandas-dev#30906: BUG: pickle files left behind by tm.round_trip_pickle (pandas-dev#30913)
Co-authored-by: jbrockmendel <[email protected]>
1 parent eb7d049 commit 85ba993

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)