[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Extra blank line on pyuic4 generated code (4.8.3)
From:       "Kelvin U.V" <kelvin.you () gmail ! com>
Date:       2011-02-22 5:19:22
Message-ID: AANLkTik0-AuTJ7tg8eKGP+sNbd4E6oMqKdtYJfJ4UADg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

> On Sat, 12 Feb 2011 18:31:49 +0800, "Kelvin U.V" <kelvin.you@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

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Tue, Feb 22, 2011 at 1:13 AM, Phil Thompson <span \
dir="ltr">&lt;<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> On Sat, 12 Feb 2011 \
18:31:49 +0800, &quot;Kelvin U.V&quot; &lt;<a \
href="mailto:kelvin.you@gmail.com">kelvin.you@gmail.com</a>&gt;<br> wrote:<br>
<div><div></div><div class="h5">&gt; Hi ,<br>
&gt;<br>
&gt; I find the pyuic4 4.8.3 will generat more newline characters in each<br>
line.<br>
&gt; 4.8.1 doesn&#39;t have this issue.<br>
&gt;<br>
&gt; Here is a temporary solution for this issue.<br>
&gt;<br>
&gt;       def _generate(self):<br>
&gt;             &quot;&quot;&quot; Generate the Python code. &quot;&quot;&quot;<br>
&gt;<br>
&gt;             if sys.hexversion &gt;= 0x03000000:<br>
&gt;                   if self._opts.output == &#39;-&#39;:<br>
&gt;                         from io import TextIOWrapper<br>
&gt;<br>
&gt; -                      pyfile = TextIOWrapper(sys.stdout.buffer,<br>
encoding=&#39;utf8&#39;)<br>
&gt; +                     pyfile = TextIOWrapper(sys.stdout.buffer,<br>
encoding=&#39;utf8&#39;,<br>
&gt; newline=&#39;&#39;)<br>
&gt;                   else:<br>
&gt;                         pyfile = open(self._opts.output, &#39;wt&#39;, \
encoding=&#39;utf8&#39;)<br> &gt;             else:<br>
&gt;                   if self._opts.output == &#39;-&#39;:<br>
&gt;                         pyfile = sys.stdout<br>
&gt;                   else:<br>
&gt;                         pyfile = open(self._opts.output, &#39;wt&#39;)<br>
&gt;<br>
&gt; Hope it can be fixed in the next release. Thanks.<br>
<br>
</div></div>I can&#39;t reproduce this (with Python v3.2) and your fix makes no<br>
difference.<br>
<font color="#888888"><br>
Phil<br>
</font></blockquote></div><br>Yes, it can not reproduce in Python 3.2.     This issue \
occurred on Python 3.1.2.   It must be the issue for TextIOWrapper.<br \
clear="all"><br>-- <br>Best Regards<br>K.Y<br>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic