pygtk 2.22 和 python 2.6 严重不稳定

发布于 2024-10-05 14:47:50 字数 1264 浏览 2 评论 0原文

有人遇到过这个吗?

我采用了 GTK HelloWorld 示例。它运行良好。但是,如果我 import win32ui,那么它不会正确关闭(如 这个问题)。

还有其他问题。在缩小应用程序范围以查看导致其无法关闭的原因的过程中,我遇到了一个问题,即我正在解构我编写的记录器类,但我没有遇到任何问题。在构造函数中,我有这样一行:

self.logger = logger

我已经注释掉了类的其余部分,因此甚至没有使用 self.logger 。如果我按原样保留该行,则在单击“Hello World”按钮时会收到此错误:

c:\python26\lib\site-packages\twisted\internet\gtk2reactor.py:350: GtkWarning: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
  gtk.main()

如果我将该行更改为:

self.logger = 0

则该错误将不会显示。记录器类中的其他各种代码行也发生了这种情况。我怀疑其他随机代码也会发生这种情况。但无论如何 - 设置一个甚至没有使用的变量应该不会导致任何类型的问题。请注意,此时我仍在使用twisted 和pygtk。我还没有用 gtk 重现这个。

这让我怀疑 pygtk 真的不稳定......以前有人遇到过这个吗?有什么我可以做的吗?我从 gtk 2.12 更新的原因是我的应用程序会随机崩溃,但这更糟糕。

更新:这些错误发生在 64 位 Windows 7 上。我尝试过使用上面列出的版本的 32 位 python,以及使用 pygtk-2.17.1、pygobject-2.21.2、pycairo-1.8 的 64 位 python。 8 和 pywin32-214。

到目前为止,在 Windows XP VirtualBox 虚拟机上进行相同的安装时,不会出现 win32ui 错误。

Has anybody come across this?

I've taken the GTK HelloWorld sample. It runs fine. However, if i import win32ui, then it does not shutdown properly (as explained in this question ).

There are other problems. In the process of narrowing down my application to see what caused it to not shutdown, I came upon a point where I was deconstructing a logger class I had written that I had no problems with. In the constructor I had the line:

self.logger = logger

I had commented out the rest of the class so self.logger was not even used. If I left the line as-is, I would get this error upon clicking the "Hello World" button:

c:\python26\lib\site-packages\twisted\internet\gtk2reactor.py:350: GtkWarning: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
  gtk.main()

If I change the line to:

self.logger = 0

then the error would not show up. This happened with various other lines of code in the logger class as well. I suspect it would happen with other random bits of code, too. But in any case - setting a variable that isn't even used should not cause any kind of problem. Note that at this point I was still using twisted with pygtk. I haven't reproduced this yet with just gtk.

This makes me suspect pygtk is being really unstable... has anybody come across this before? Is there anything I can do? The reason I updated from gtk 2.12 was because my application would crash randomly, but this is far worse.

UPDATE: The bugs happen on 64-bit Windows 7. I've tried both with 32-bit python with the versions listed above, and 64-bit python with pygtk-2.17.1, pygobject-2.21.2, pycairo-1.8.8 and pywin32-214.

So far the win32ui bug does not happen with the same install on a Windows XP VirtualBox virtual machine.

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

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

发布评论

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

评论(1

默嘫て 2024-10-12 14:47:50

我已经在另一台计算机上的不同安装的 Win7 64 位上尝试过此操作,并且运行良好。因此,特定计算机上的硬件/其他软件有些奇怪。可能与 gtk 或 win32 无关。

I've tried this on a different install of Win7 64-bit on a different computer, and it worked fine. So it's some strange thing with the hardware/other software on a particular computer. Probably nothing gtk or win32 related.

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