Skip to content

Commit

Permalink
Use tempfile.gettempdir() instead of a hardcoded temp root. (#570)
Browse files Browse the repository at this point in the history
* Use `tempfile.gettempdir()` instead of a hardcoded temp root.

* Lint.
  • Loading branch information
knighton authored Jan 22, 2024
1 parent e109e9f commit aacea8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion streaming/base/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from concurrent.futures._base import Future
from enum import IntEnum
from math import ceil
from tempfile import gettempdir
from threading import Event, Lock
from time import sleep, time_ns
from typing import Any, Dict, Iterator, Optional, Sequence, Tuple, Union
Expand Down Expand Up @@ -512,7 +513,7 @@ def __init__(self,
]
self._shm_prefix_int, self._locals_shm = get_shm_prefix(streams_local, streams_remote,
world)
self._filelock_root = os.path.join(os.path.sep, 'tmp', 'streaming')
self._filelock_root = os.path.join(gettempdir(), 'streaming')
os.makedirs(self._filelock_root, exist_ok=True)

# Create the shared memory-backed barrier, without its lock, which is unpickleable.
Expand Down

0 comments on commit aacea8b

Please sign in to comment.