◐ Shell
clean mode source ↗

Message 70816 - Python tracker

I'm not sure this is bug or not, but shouldn't `io' be collected by
refcount GC? This happens on python2.5 but doesn't happend on python3.0.

import os

def foo():
    io = open("a.txt", "w")
    raise RuntimeError()

try:
    foo()
except:
    pass

os.remove("a.txt") # WindowsError (Error32)
    # Process cannot access to the file.
    # Another process is using it.