Bug 1294307 - Missing files in qscintilla-python cause pyuic4 to generate Python code with broken import
Summary: Missing files in qscintilla-python cause pyuic4 to generate Python code with ...
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: qscintilla
Version: epel7
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-26 17:45 UTC by Kuan-Yi Li
Modified: 2016-02-29 19:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Kuan-Yi Li 2015-12-26 17:45:17 UTC
Description of problem:
In RHEL/CentOS 7, unlike in RHEL/CentOS 6, certain files in widget-plugins are explicitly removed from official PyQt4 package.

*** excerpt from official PyQt4.spec ***

# qscintilla
%if ! 0%{?qscintilla}
  rm -rf %{buildroot}%{python3_sitearch}/PyQt4/uic/widget-plugins/qscintilla* \
         %{buildroot}%{python_sitearch}/PyQt4/uic/widget-plugins/qscintilla*
%endif

# webkit
%if ! 0%{?webkit}
  rm -rf %{buildroot}%{python3_sitearch}/PyQt4/uic/widget-plugins/qtwebkit* \
         %{buildroot}%{python_sitearch}/PyQt4/uic/widget-plugins/qtwebkit*
%endif

*** end of excerpt ***

Files like qscintilla.py in widget-plugins should be added back when installing qscintilla-python -- otherwise pyuic4 will generate code with broken import while processing .ui files that use Qsci.

As other widget-plugins are placed in official PyQt4 package, I would personally suggest following changes:
1. Put qscintilla.py into qscintilla-python package
2. Make qscintilla-python-devel requires qscintilla-python


Version-Release number of selected component (if applicable):
2.4-1


How reproducible:
Always


Steps to Reproduce:
1. Install PyQt4, PyQt4-devel, qscintilla-python, qscintilla-python-devel
2. cd /tmp
3. wget https://github.com/qgis/QGIS/raw/release-2_8/python/console/console_compile_apis.ui
4. pyuic4 console_compile_apis.ui --output=ui_console_compile_apis.py
6. pyuic4 --debug --preview console_compile_apis.ui


Actual results:
Program exits with error.
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/port_v2/invoke.py", line 39, in invoke
    exit_status = driver.invoke()
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/driver.py", line 62, in invoke
    return self._preview()
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/driver.py", line 76, in _preview
    widget = loadUi(self._ui_file)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/__init__.py", line 238, in loadUi
    return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/Loader/loader.py", line 71, in loadUi
    return self.parse(filename, resource_suffix, basedir)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 933, in parse
    actor(elem)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 772, in createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 750, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 461, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 750, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 504, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 750, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 215, in createWidget
    self.stack.push(self.setupObject(widget_class, parent, elem))
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/uiparser.py", line 176, in setupObject
    obj =  self.factory.createQObject(clsname, name, args, is_attribute)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/objcreator.py", line 106, in createQObject
    factory = self.findQObjectType(classname)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/objcreator.py", line 131, in findQObjectType
    w = module.search(classname)
  File "/usr/lib64/python2.7/site-packages/PyQt4/uic/Loader/qobjectcreator.py", line 107, in search
    module = __import__(mname, {}, {}, (cls,))
ImportError: No module named Qsci.qsciscintilla


Expected results:
A window should open without error.
If everything works correctly, generated Python code (ui_console_compile_apis.py) should end with "from PyQt4 import Qsci" instead of "from Qsci.qsciscintilla import QsciScintilla".


Additional info:
Same problem exists in package "PyQt4-webkit".

Comment 1 Kuan-Yi Li 2016-01-07 13:38:35 UTC
Oops! Version-Release number should be 2.8-1.

Comment 2 Kuan-Yi Li 2016-02-21 13:41:51 UTC
Anyone seeing this?

Comment 3 Rex Dieter 2016-02-29 19:28:41 UTC
I think you should file this bug against PyQt4, and ask that those files a no longer explicitly removed.

I don't think this is fixable here (in qscintilla packaging).


Note You need to log in before you can comment on or make changes to this bug.