Hi Phil,<div><br></div><div>I did a lot of tests about this bug and I still can't understand where it comes from.</div><div>At least I've succeeded in narrowing down the test cases:</div><div><br></div><div>* test #1:</div>
<div><br></div><div>from PyQt4.QtGui import QFileDialog, QApplication</div><div>app = QApplication([])
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">filename = QFileDialog.getSaveFileName(None)</p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">
<br></p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">* test #2:</p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">
<br></p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">from PyQt4.QtGui import QFileDialog, QPushButton, QApplication</p><p></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">from PyQt4.QtCore import SIGNAL</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">app = QApplication([])</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">button = QPushButton("Test", None)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">button.connect(button, SIGNAL("clicked()"),</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> lambda: QFileDialog.getSaveFileName(None))</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">button.show()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">app.exec_()</p><p></p></div><div><br></div><div>I'm running these tests in Spyder's external console: this is a console widget (QPlainTextEdit) showing stdin, stdout and stderr of a Python or IPython interpreter running in a QProcess (see this screenshot: <a href="http://spyderlib.googlegroups.com/web/ipython.png">http://spyderlib.googlegroups.com/web/ipython.png</a>). </div>
<div>Running test #1 is a success in every situation (simple Python interpreter or IPython running).</div><div>On the contrary, running test #2 gives the following results:</div><div> * simple Python interpreter: ok</div>
<div> * IPython: the GUI freezes when clicking the button, and it unfreezes when sending something in QProcess' stdin (like pressing <ENTER> in the console).</div><div><br></div><div>Apparently the only difference between these two tests is that I'm running QApplication's event loop in test #2.</div>
<div>But note that this freezing situation is only happening for QFileDialog's static methods (getOpenFileName, getSaveFileName, and so on) and is never happening for other kinds of widgets or dialog boxes... and I remember seeing a message in stdout when using these methods in PyQt v4.3 (something like "redirecting in win32 console") suggesting that these methods were doing weird things on stdin/stdout and that it could be related to this bug.</div>
<div><br></div><div>I'm stuck with this bug, so I would really appreciate your help!</div><div>Note that it's excellent news to be able to embed IPython in a PyQt-based IDE: this will be the first time an IDE is able to provide such powerful feature... so this is also great news for PyQt!</div>
<div><br></div><div>Thanks,</div><div>Pierre</div>