Bug 1294307 - Missing files in qscintilla-python cause pyuic4 to generate Python code with broken import
Missing files in qscintilla-python cause pyuic4 to generate Python code with ...
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: qscintilla (Show other bugs)
epel7
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-26 12:45 EST by Kuan-Yi Li
Modified: 2016-02-29 14:28 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kuan-Yi Li 2015-12-26 12:45:17 EST
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 08:38:35 EST
Oops! Version-Release number should be 2.8-1.
Comment 2 Kuan-Yi Li 2016-02-21 08:41:51 EST
Anyone seeing this?
Comment 3 Rex Dieter 2016-02-29 14:28:41 EST
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.