Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python console error when using PyQt4 4.11 on Debian #19014

Closed
qgib opened this issue Jun 17, 2014 · 2 comments
Closed

python console error when using PyQt4 4.11 on Debian #19014

qgib opened this issue Jun 17, 2014 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API

Comments

@qgib
Copy link
Contributor

qgib commented Jun 17, 2014

Author Name: Richard Duivenvoorde (@rduivenvoorde)
Original Redmine Issue: 10610
Affected QGIS version: 2.2.0
Redmine category:pyqgis_console


Recently on a fresh QGIS build (both master and 2.2) I cannot open the Python Console anymore.

Traceback (most recent call last):
  File "", line 2, in 
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/console.py", line 43, in show_console
    _console = PythonConsole( parent )
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/console.py", line 75, in __init__
    self.console = PythonConsoleWidget(self)
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/console.py", line 99, in __init__
    self.options = optionsDialog(self)
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/console_settings.py", line 33, in __init__
    self.setupUi(self)
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/ui_console_settings.py", line 543, in setupUi
    self.retranslateUi(SettingsDialogPythonConsole)
  File "/home/richard/apps/qgis/master/debug/share/qgis/python/console/ui_console_settings.py", line 552, in retranslateUi
    item.setText(_translate("SettingsDialogPythonConsole", "APIs", None))
AttributeError: 'NoneType' object has no attribute 'setText'

After some investigation it looked like the only difference is the (by pyqt4) generated 'ui_console_settings.py' file.

This file is generated from attached 'console_settings.ui' which hasn't changed for some time (at least not between 2.2 and master).

Only difference seems

@ -101,7 +101,7 @@ class Ui_SettingsDialogPythonConsole(object):
         self.tableWidget.setGridStyle(QtCore.Qt.SolidLine)
         self.tableWidget.setRowCount(0)
         self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
-        self.tableWidget.setColumnCount(2)
+        self.tableWidget.setRowCount(0)
         item = QtGui.QTableWidgetItem()
         self.tableWidget.setHorizontalHeaderItem(0, item)
         item = QtGui.QTableWidgetItem()

looks like an error from pyqt4, as 4.11 generated two lines self.tableWidget.setRowCount(0) where one of them should have been self.tableWidget.setColumnCount(2)

attached also the different .py files:


@qgib
Copy link
Contributor Author

qgib commented Jun 17, 2014

Author Name: Jürgen Fischer (@jef-n)


fixed in 3f62330


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jun 17, 2014

Author Name: Richard Duivenvoorde (@rduivenvoorde)


thanks jurgen for this workaround. I have my console back!

Just for completeness, it seems to be a pyqt bug which is suppossed to be fixed in a next release:

http://www.riverbankcomputing.com/pipermail/pyqt/2014-June/034400.html

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

1 participant