[PyQt] UnicodeDecodeError with output from Windows OS command

J Barchan jnbarchan at gmail.com
Thu Nov 30 11:30:48 GMT 2017


On 30 November 2017 at 11:24, Florian Bruhin <me at the-compiler.org> wrote:

> On Thu, Nov 30, 2017 at 12:12:17PM +0100, Valentin Valls wrote:
> > stream = qt.QDataStream(byte_array, qt.QIODevice.ReadOnly)
> > my_string = stream.readQString()
>
> This really isn't what a QDataStream is for... and I don't see how it could
> work. For me, it doesn't:
>
>     >>> from PyQt5 import QtCore
>     >>> ba = QtCore.QByteArray(b'hello')
>     >>> s = QtCore.QDataStream(ba, QtCore.QIODevice.ReadOnly)
>     >>> s.readQString()
>     ''
>
> Florian
>
> --
> https://www.qutebrowser.org  | me at the-compiler.org (Mail/XMPP)
>    GPG: 916E B0C8 FD55 A072  | https://the-compiler.org/pubkey.asc
>          I love long mails!  | https://email.is-not-s.ms/
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>


​Oh!  So it doesn't look like that is the right way to address the problem
then...?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20171130/0425d234/attachment.html>


More information about the PyQt mailing list