[PyQt] Extra blank line on pyuic4 generated code (4.8.3)

Kelvin U.V kelvin.you at gmail.com
Tue Feb 22 05:19:22 GMT 2011


On Tue, Feb 22, 2011 at 1:13 AM, Phil Thompson
<phil at riverbankcomputing.com>wrote:

> On Sat, 12 Feb 2011 18:31:49 +0800, "Kelvin U.V" <kelvin.you at gmail.com>
> wrote:
> > Hi ,
> >
> > I find the pyuic4 4.8.3 will generat more newline characters in each
> line.
> > 4.8.1 doesn't have this issue.
> >
> > Here is a temporary solution for this issue.
> >
> >     def _generate(self):
> >         """ Generate the Python code. """
> >
> >         if sys.hexversion >= 0x03000000:
> >             if self._opts.output == '-':
> >                 from io import TextIOWrapper
> >
> > -               pyfile = TextIOWrapper(sys.stdout.buffer,
> encoding='utf8')
> > +              pyfile = TextIOWrapper(sys.stdout.buffer,
> encoding='utf8',
> > newline='')
> >             else:
> >                 pyfile = open(self._opts.output, 'wt', encoding='utf8')
> >         else:
> >             if self._opts.output == '-':
> >                 pyfile = sys.stdout
> >             else:
> >                 pyfile = open(self._opts.output, 'wt')
> >
> > Hope it can be fixed in the next release. Thanks.
>
> I can't reproduce this (with Python v3.2) and your fix makes no
> difference.
>
> Phil
>

Yes, it can not reproduce in Python 3.2.   This issue occurred on Python
3.1.2.  It must be the issue for TextIOWrapper.

-- 
Best Regards
K.Y
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110222/45dbe1c2/attachment.html>


More information about the PyQt mailing list