PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1156 - PySide 1.1.0 compile error when assigning radio buttons into a button group
: PySide 1.1.0 compile error when assigning radio buttons into a button group
Status: WAITING
Product: PySide
Classification: Unclassified
Component: pyside-tools
: 1.1.0
: PC Linux
: P5 major
Assigned To: infinity.probability
:
:
:
  Show dependency treegraph
 
Reported: 2012-02-27 21:31 EET by vklikar
Modified: 2012-02-28 17:14 EET (History)
9 users (show)

See Also:


Attachments
UI file created using QtDesigner (1.17 KB, application/x-designer)
2012-02-27 22:49 EET, infinity.probability
Details
Python file created using pyside-uic before error (562 bytes, text/x-python)
2012-02-27 22:50 EET, infinity.probability
Details
Corrected bug (31.23 KB, patch)
2012-02-27 23:18 EET, infinity.probability
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vklikar 2012-02-27 21:31:18 EET
Test case:
I created two radio buttons and assigned them into a button group. This caused
compilation error when I tried to compile it by pyside-uic.

I'm using:
Windows 7 (64bit)
Python 2.7.2 (32bit)
PySide 1.1.0

Traceback (most recent call last):
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\port_v2\invoke.py",
line 34, in invoke
    exit_status = driver.invoke()
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\driver.py",
line 60, in invoke
    self._generate()
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\driver.py",
line 94, in _generate
    compileUi(self._ui_file, pyfile, self._opts.execute, self._opts.indent,
self._opts.from_imports)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\__init__.py",
line 142, in compileUi
    winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\Compiler\compiler.py",
line 91, in compileUi
    w = self.parse(input_stream)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\uiparser.py",
line 867, in parse
    actor(elem)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\uiparser.py",
line 710, in createUserInterface
    self.traverseWidgetTree(elem)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\uiparser.py",
line 688, in traverseWidgetTree
    handler(self, child)
  File
"C:\Python27\lib\site-packages\pyside-1.1.0qt474-py2.7-win32.egg\pysideuic\uiparser.py",
line 212, in createWidget
    bg_name = bg_i18n.string
AttributeError: 'str' object has no attribute 'string'
Comment 1 infinity.probability 2012-02-27 22:49:29 EET
Created attachment 498 [details]
UI file created using QtDesigner

UI file created using QtDesigner
Comment 2 infinity.probability 2012-02-27 22:50:53 EET
Created attachment 499 [details]
Python file created using pyside-uic before error

Python file created using pyside-uic before error
Comment 3 infinity.probability 2012-02-27 22:51:15 EET
pyside-group-bug$ pyside-uic -d test.ui -o ui_test
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pysideuic/port_v2/invoke.py", line 34,
in invoke
    exit_status = driver.invoke()
  File "/usr/lib/python2.7/dist-packages/pysideuic/driver.py", line 60, in
invoke
    self._generate()
  File "/usr/lib/python2.7/dist-packages/pysideuic/driver.py", line 94, in
_generate
    compileUi(self._ui_file, pyfile, self._opts.execute, self._opts.indent,
self._opts.from_imports)
  File "/usr/lib/python2.7/dist-packages/pysideuic/__init__.py", line 142, in
compileUi
    winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports)
  File "/usr/lib/python2.7/dist-packages/pysideuic/Compiler/compiler.py", line
91, in compileUi
    w = self.parse(input_stream)
  File "/usr/lib/python2.7/dist-packages/pysideuic/uiparser.py", line 867, in
parse
    actor(elem)
  File "/usr/lib/python2.7/dist-packages/pysideuic/uiparser.py", line 710, in
createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.7/dist-packages/pysideuic/uiparser.py", line 688, in
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.7/dist-packages/pysideuic/uiparser.py", line 212, in
createWidget
    bg_name = bg_i18n.string
AttributeError: 'str' object has no attribute 'string'
Comment 4 infinity.probability 2012-02-27 22:52:08 EET
Running Debian Sid amd64
Comment 5 infinity.probability 2012-02-27 23:18:17 EET
Created attachment 500 [details]
Corrected bug

Changed line 212 of uiparser.py, from 

bg_name = bg_i18n.string 

to 

bg_name = bg_i18n

And tested, and it seems to be working correctly.
Comment 6 vklikar 2012-02-28 17:14:36 EET
Thanks. It works for me to.