PR#4382: deprecate pathinfo.tmpdir

Merges #4382
https://pagure.io/koji/pull-request/4382

Fixes #4384
https://pagure.io/koji/issue/4384
This commit is contained in:
Tomas Kopecek 2025-05-06 12:50:15 +02:00
commit b63ef8ae3d

View file

@ -2456,6 +2456,9 @@ class PathInfo(object):
def tmpdir(self, volume=None):
"""Return a path to a unique directory under work()/tmp/"""
deprecated(
'PathInfo.tmpdir() is deprecated and will be removed in a future version of Koji')
# this function has never really been used in koji
tmp = None
while tmp is None or os.path.exists(tmp):
tmp = self.work(volume) + '/tmp/' + ''.join([random.choice(self.ASCII_CHARS)