This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vkisforever
Recipients vkisforever
Date 2021-02-22.04:22:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
ran python 3.9.2 on windows 10

1) What did you do?
Tried to remove folder that contains a xml file that was worked on by ElementTree iterparse with argument source='filename' (string type input)
2. What happened?
python was not able to remove the folder due to file lock still held by iterparse.
3. What did you expect to happen
iterparse was supposed to close the filehandle such that the user could then write/move/delete the xml file worked on, however python gave a PermissionError:

Traceback (most recent call last):
  File "C:\Users\vkisf\Desktop\00_MYSTUFF\01_SOFTWARE\01_PYTHON\01_GITHUB\pycascades2021\", line 43, in <module>
  File "C:\Users\vkisf\Desktop\00_MYSTUFF\01_SOFTWARE\01_PYTHON\01_GITHUB\pycascades2021\cpython\lib\", line 740, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\vkisf\Desktop\00_MYSTUFF\01_SOFTWARE\01_PYTHON\01_GITHUB\pycascades2021\cpython\lib\", line 618, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\vkisf\Desktop\00_MYSTUFF\01_SOFTWARE\01_PYTHON\01_GITHUB\pycascades2021\cpython\lib\", line 616, in _rmtree_unsafe
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'subdir2\\app.xml'
Date User Action Args
2021-02-22 04:22:11vkisforeversetrecipients: + vkisforever
2021-02-22 04:22:11vkisforeversetmessageid: <>
2021-02-22 04:22:11vkisforeverlinkissue43292 messages
2021-02-22 04:22:10vkisforevercreate