[issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization

Xiang Zhong report at bugs.python.org
Sun May 2 18:33:35 EDT 2021


New submission from Xiang Zhong <zhongxiang117 at gmail.com>:

The variable of instance cannot be reused in two consecutive codes chunk combinations. Please check the difference in attached file, xtempfile.py, function: test_3 & test_4.

However, surprisingly, the problem can be fixed in test_5 and test_6.

Which may be helpful for debug: why does the value of "id(fd.name)" keep constant all the time inside those combinations?

----------
components: Library (Lib)
files: xtempfile.py
messages: 392746
nosy: zhongxiang117
priority: normal
severity: normal
status: open
title: tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50004/xtempfile.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44013>
_______________________________________


More information about the Python-bugs-list mailing list