PiotrDabkowski / Js2Py

JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python🚀 Try it online:
http://piter.io/projects/js2py
MIT License
2.45k stars 259 forks source link

Js2py leaves directory in /tmp whenever it is imported #294

Open oliver opened 1 year ago

oliver commented 1 year ago

It looks like the statement import js2py will cause an (empty) directory to be created in /tmp/, which will not be removed after the process has exited. I had a Python process which used Js2py and which (due to some unrelated bug) was restarted all the time; and on each start it created an empty directory in /tmp/, e.g. /tmp/tmpe1ira7kj/. After a few days there were several hundred thousand empty directories. Since each directory took 4 KB of disk space, they took up some hundred MB of temp space.

Would it be possible to delete the directories when the process ends, e.g. with the atexit module?

Also, it would be great if the name of the new directory mentioned Js2py, to make it easier to find out where the directory comes from.