<div dir="ltr"><div><div><div><div>In converting a PyQt4 program to PyQt5 I ran into an error because under PyQt5 (5.2), QFileDialog.getOpenFileName() returns a tuple of two strings. The first is either a path or null depending on the Cancel button, and the second always null.<br>

<br>According to the C++ doc for getOpenFileName [1], the returned value is a string, and "<span style="color:rgb(54,53,52);font-family:'Open Sans',sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:20px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">If the user presses Cancel, it returns a null string."</span> In the PyQt4 doc [2] it shows getOpenFileName returning a string (although it mentions that the three get...Filter methods return tuples).<br>

</div><br></div>Was the behavior of getOpenFileName changed deliberately or is this a bug?<br><br></div>Thanks,<br></div>Dave Cortesi<br><div><div><div><div><br>[1] <a href="http://qt-project.org/doc/qt-5/qfiledialog.html#getOpenFileName">http://qt-project.org/doc/qt-5/qfiledialog.html#getOpenFileName</a><br>

[2] <a href="http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qfiledialog">http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qfiledialog</a><br></div></div></div></div></div>