Re: [bug] QFontMetrics Regression in 5.13 on Python2

Chris Billington <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CAKy3cVurE49_aEvH0pdvu80S=Yo6fYrAUu_NkBThQEe7pf=aWA@mail.gmail.com>
Fantastic, thanks very much Phil.

-Chris

On Thu, Jul 11, 2019 at 9:35 AM Phil Thompson <[email protected]>
wrote:

> On 08/07/2019 15:18, Chris Billington wrote:
> > The following example raises an exception on Python 2 with PyQt5 5.13.
> > It
> > does not raise an exception on Python 3 or on PyQt5 5.12.3.
> >
> > from PyQt5.QtWidgets import QApplication
> > from PyQt5.QtGui import QFontMetrics
> > app = QApplication([])
> > QFontMetrics(app.font()).inFont(u'\u2605')
> >
> > Traceback (most recent call last):
> >   File "292.py", line 4, in <module>
> >     QFontMetrics(app.font()).inFont(u'\u2605')
> > ValueError: string of length 1 expected
> >
> > This causes tortoisehg to crash for example, as it contains the above
> > QFontMetrics call. u'\u2605' looks like a string of length one to me,
> > so
> > this looks like perhaps confounding byte-length with codepoint-length.
>
> This will be fixed in tonight's snapshot.
>
> It's actually a bad regression (but only affects Python v2) so there
> will be a v5.13.1 release soon.
>
> Thanks,
> Phil
>

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.