[PyQt] PyQt5 QtSerialPort Error "QSocketNotifier: Invalid socket specified"

Phil Thompson phil at riverbankcomputing.com
Sat Sep 10 18:45:06 BST 2016


On 6 Sep 2016, at 4:49 pm, Dan Arbogast <arbogastdan at gmail.com> wrote:
> 
> I'm trying to use QtSerialPort for a PyQt5 project but haven't found the magic. Right now the code seems to be opening the port fine but I'm getting "QSocketNotifier: Invalid socket specified" error whenever I try to write to the open port. The code is attached.
> 
> Running Ubuntu 16.04, PyQt5, Qt 5.6.0
> 
> The output from this code on my machine is:
> 
> ttyUSB0
> ttyUSB1
> False
> True
> QSocketNotifier: Invalid socket specified
> 
> Any idea what is causing the QSocketNotifier error, or how to troubleshoot it?  If you run this on your machine do you get the same error?
> 
> Thanks for any help you might share.

Try calling open() rather than setOpenMode().

Phil


More information about the PyQt mailing list