Simple question: Not closing a file


What kind of “doom” will happen is I don’t use .close()?


This depends, Cpython will close the file while Jpython will not, so you can’t rely on python to close the file. So then the file stick around in memory (RAM). Which can become very problematic if you have to open many or larger files, you don’t give the memory back to the operating system.


If I had been patient I would have had my question answered in 6/9. But it didn’t mention anything about Cpython and Jpython. Thanks!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.