classification
Title: tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: zhongxiang117
Priority: normal Keywords:

Created on 2021-05-02 22:33 by zhongxiang117, last changed 2021-05-02 22:33 by zhongxiang117.

Files
File name Uploaded Description Edit
xtempfile.py zhongxiang117, 2021-05-02 22:33 codes reproduce
Messages (1)
msg392746 - (view) Author: Xiang Zhong (zhongxiang117) Date: 2021-05-02 22:33
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?
History
Date User Action Args
2021-05-02 22:33:35zhongxiang117create