Can't remove a file which created by `tempfile.mkstemp()` on Windows
<p>Here's my example code:</p>

<pre><code>import os
from tempfile import mkstemp

fname = mkstemp(suffix='.txt', text=True)[1]
os.remove(fname)
</code></pre>

<p>When I run it on my Linux, it works fine. But when I run it on my Windows XP using Python 3.4.4, it raised the following error:</p>

<pre><code>Traceback (most recent call last):
  File "C:\1.py", line 5, in &lt;module&gt;
    os.remove(fname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\DOCUME~1\\IEUser\\LOCALS~1\\Temp\\tmp3qv6ppcf.txt'
</code></pre>

<p>However, when I use <code>tempfile.NamedTemporaryFile()</code> to create a temp file and close it, it removed automatically. </p>

<p>Why Windows can't remove files created by <code>mkstemp</code>? Where am I doing wrong?</p>