maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   python evolution + QFileDialog = seg fault? (https://talk.maemo.org/showthread.php?t=45849)

tgalal 2010-02-25 19:20

python evolution + QFileDialog = seg fault?
 
I'm trying to browse and select file using a QFileDialog. The file dialog opens successfully, but the moment I scroll or open a folder that has a file that can be selected, the app crashes printing a segmentation fault.

After some digging in the code I found that this has to do with importing evolution. Here is a simple example:

Code:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
import evolution

app = QApplication(sys.argv)

win = QMainWindow()

win.show()

path = QFileDialog.getOpenFileName(None,"Open Image", "/home/user/", "Image Files (*.png *.jpg *.bmp)");

sys.exit(app.exec_())

This program crashes on maemo 5, but if you remove "import evolution", or run just run it on computer, the File Dialog selects a file successfully. Why is that?!

tgalal 2010-02-26 18:22

Re: python evolution + QFileDialog = seg fault?
 
I really need some help here. This is a project that I'm about to submit a first release in and I'm stuck at this so I would appreciate any help :) why is the conflict between evolution and QFileDialog?! I also tried to un-import evolution after using it by calling "del evolution" but the segmentation fault remains :S

Jaffa 2010-03-02 17:17

Re: python evolution + QFileDialog = seg fault?
 
Is this in Scratchbox or just on the device? I've packaged python-evolution, but I'm not an expert on its code - and even less of an expert on PyQt.

Does it happen if you switch to Pyside? That might indicate whether it's a Python, a Qt or a PyQt problem.

tgalal 2010-03-02 17:44

Re: python evolution + QFileDialog = seg fault?
 
I tried switching to PySide, same result.. Only more it prints a couple of warnings on initializing QApplication but I don't think that's related..

On scratchbox:

Code:

/usr/bin/run-standalone.sh: line 11:  7006 Segmentation fault      (core dumped) "$@"

Jaffa 2010-03-02 22:54

Re: python evolution + QFileDialog = seg fault?
 
Scratchbox x86 or armel target or both?

tgalal 2010-03-03 00:05

Re: python evolution + QFileDialog = seg fault?
 
Both. But on armel, when I run it without using run-standalone.sh, it shows a native file chooser, and does not crash!

v13 2010-03-06 13:41

Re: python evolution + QFileDialog = seg fault?
 
I have the same problem with pyqt under n900 P1.1 directly.

EDIT: Without importing evolution.

EDIT: Using QFileDialog directly it worked very well.

EDIT: Partially solved: Was fixed when I removed "import gst, pygst" (which in my case were not needed).

attila77 2010-03-06 13:54

Re: python evolution + QFileDialog = seg fault?
 
The issue you talk about is AFAICT Qt specific (in fact, I have the very same problem with quickbrownfox, which is a C++ app)

tgalal 2010-03-06 14:08

Re: python evolution + QFileDialog = seg fault?
 
1 Attachment(s)
I had to fall back to this ugly file dialog :(

tastalian 2010-05-31 22:28

Re: python evolution + QFileDialog = seg fault?
 
Same problem with the last version of PyQt4 under Maemo 5 (PR1.2): QFileDialog.getOpenFileName() -> segfault once a file is selected.

Is this bug submitted somewhere?
Is there a known walkaround now?


All times are GMT. The time now is 13:34.

vBulletin® Version 3.8.8