pyinstaller一个文件包崩溃时要留下临时文件,如何自动清洁这些文件?

发布于 2025-02-09 04:14:08 字数 307 浏览 3 评论 0原文

我正在使用pyinstaller创建一个使用命令行的文件可执行文件。像所有“一个文件” Exeutables一样,它每次打开时都会在OS的一个临时文件夹中提取二进制文件/依赖项。通常,它在正确关闭应用程序后清洁了这些内容,但是当我关闭命令行(或应用程序崩溃时)时,它将所有提取的临时文件留在该临时文件夹中。并且它每次打开应用程序时都会创建新的temp文件夹(并带有名称“ _meixxxxxx”),因此,如果未手动清洁,旧的崩溃的临时温度会留在那里。 我使用- Runtime-tmpdir参数来指定一个单独的临时文件夹,但那里也发生了同样的情况。有什么解决方法吗?

I am using pyinstaller to create one file executable with command line. Like all "one file" exeutables, it extracts binaries/dependencies in one temporary folder of OS whenever opened. It generally clean those after closing the application properly but when I close the command line (or when the app crashes) then it leaves all those extracted temp files behind in that temp folder. And it creates new temp folder (with name "_MEIxxxxxx") every time I open the app, so the old crashed temp stays there if not cleaned manually.
I used the --runtime-tmpdir parameter to specify one separate temp folder, but the same is happening there also. Any fix to this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十年不长 2025-02-16 04:14:08

这个问题从很长一段时间内就存在,但终于在新的5.3版本中修复了。

因此,对于那些面临此问题的人,只需将Pyinstaller更新到最新版本(5.3+)。

现在,如果我们关闭“父控制台”窗口或终止任务管理器中的进程,或者即使我们关闭系统,则“ _meixxxxxx”文件夹将被删除。

您可以查看完整的changelog 在这里

This issue was there from a very long time, but it's finally fixed in the new 5.3 version.

So for those who are facing this issue, just update pyinstaller to the latest version (5.3+).

Now the "_MEIxxxxxx" folder gets deleted if we close the parent console window or terminate the process in task-manager or even if we shutdown the system.

You can view the full changelog here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文