Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-629

QtCore.QSocketNotifier attempts to call "fileno" on it's first param when instantiated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.11.1
    • PySide
    • None
    • Python 2.7.12
    • 43451e3bc17467593df64cb73ce8c0bf9e60045f

    Description

       

      import socket
      
      from PySide2 import QtCore,QtWidgets
      
      app = QtWidgets.QApplication([])
      
      w_sock, r_sock = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
      notifier = QtCore.QSocketNotifier(r_sock.fileno(), QtCore.QSocketNotifier.Read)
      # >>> AttributeError: 'int' object has no attribute 'fileno'

       

      This is inconsistent with all other bindings and seems like a weird opinion to make in the PySide2 binding, to accept a socket object.

       

      I think this is a bug and not a conscious design decision, please correct me if I am wrong however.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            ahuge Alex Hughes
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change