Skip to content

Commit a8fff9e

Browse files
committed
Deprecate mktemp() to use a safer function.
1 parent 801cf3f commit a8fff9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/asyncio/windows_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131

3232
def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
3333
"""Like os.pipe() but with overlapped support and using handles not fds."""
34-
address = tempfile.mktemp(
35-
prefix=r'\\.\pipe\python-pipe-{:d}-{:d}-'.format(
36-
os.getpid(), next(_mmap_counter)))
34+
address = r'\\.\pipe\python-pipe-{:d}-{:s}'.format(os.getpid(),
35+
str(uuid.uuid4()))
3736

3837
if duplex:
3938
openmode = _winapi.PIPE_ACCESS_DUPLEX

0 commit comments

Comments
 (0)