[Eric] Failure to try PySide

Detlev Offenbach detlev at die-offenbachs.de
Fri Oct 29 12:14:03 BST 2010

On Montag, 25. Oktober 2010, Algis Kabaila wrote:
> Hi Detlev,
> I am a real fan of Eric - it is a great program and a teaching tool as
> well.  For this reason i want to draw your attention to a situation
> where Eric fails.  For the record, I use the binaries from ubuntu
> 10.10 repositories, including Eric - 4.4.4a (r3717).  I attempted to
> try our PySide,  which in essence is an early incarnation of a clone
> of PyQt.  My OS is kubuntu 10.10.  I suspect that OS is the real
> cause of my problems and I am considering of moving to a gnome version
> of ubuntu for my programming exercises, which may well make Eric more
> robust.
> This is my very simple trial program to to test PySide against PyQt:
> #!/usr/bin/env python
> ''' trypyside.py - minimal try program'''
> import sys
> # default = 1 -> use PyQt, else use PySide
>     from PyQt4 import (QtGui, QtCore)
> else:
>     from PySide  import (QtGui, QtCore)
> class MainWindow(QtGui.QMainWindow):
>     def __init__(self, parent=None):
>         super(MainWindow, self).__init__(parent)
> if __name__ == '__main__':
>     app = QtGui.QApplication(sys.argv)
>     frame = MainWindow()
>     frame.show()
>     app.exec_()
> In Eric  it fails on  line 19 (app = QtGui.QApplication(sys.argv) with
> an error message "The debugger program raised the exception TypeError
> "bad argument for a built in operation".
> The same program from a command line works OK and here is the dialog:


this is not an eric4 issue but rather a PySide bug. In the eric4 debugger 
backend all strings are handled as unicode. That means sys.argv is 
[u'trypyside.py']. PySide doesn't seem to convert unicode strings to QString. 
You should report a bug to the PySide people. To reproduce the issue just 
execute these lines in a Python console.

>>> from PySide import QtGui
>>> import sys
>>> app = QtGui.QApplication([u"pyside.py"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: bad argument type for built-in operation

Detlev Offenbach
detlev at die-offenbachs.de

More information about the Eric mailing list