[PyQt] Problem with pyrcc / compression

Phil Thompson phil at riverbankcomputing.com
Fri Mar 18 12:31:26 GMT 2011

On Tue, 15 Mar 2011 14:35:00 +0100, Giuseppe Corbelli
<giuseppe.corbelli at copanitalia.com> wrote:
> Hi all
> weird situation happening with PyQt 4.8.3/Qt 4.7.1/Python 2.6.6 on
> I create a .qrc like the one attached. Then I "compile" it using
> cowo at cowo:~/tmp/x$ pyrcc4 -verbose -compress 9 -o r_application_rc.py
> r_application.qrc
> PyQt4 resource compiler
> Processing 1 files
> Interpreting r_application.qrc
> Outputting code
> The file within is also attached. It's a simple INI file renamed to .py
> because I need the text within to be translated. It's UTF8 encoded but I
> don't
> think it should make any difference.
> The r_application_rc.py is built and some data is put in. However, when
> run
> the (also attached) test.py, nothing is returned. The resource is opened
> but
> appears to be empty.
> If I run pyrcc4 without compression everything works fine.

Fixed in tonight's snapshot.

It's actually a bug in the wrapping of QResource.data(), pyrcc4 is fine.
However I've also changed pyrcc4 so that it now compresses by default (to
match what rcc does).

Thanks for the test case,

More information about the PyQt mailing list