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

qfile_test fails randomly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.9
    • PySide
    • Linux 4.14.13-1-ARCH
      Python 3.6.4
      Qt 5.9
      PySide 5.9

    Description

      The qfile_test fails frequently because of an error on testBasic(self),
      in the second assert self.assertFalse(obj.getChar()[0]):

      _
      63: Traceback (most recent call last):
      63: File "/home/crmaurei/dev/pyside5.9/sources/pyside2/tests/QtCore/qfile_test.py", line 72, in testBasic
      63: self.assertFalse(obj.getChar()[0])
      63: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x85 in position 0: invalid start byte
      _

      The current version of the test uses a function to encode the bytes in UTF8 which is defined in sources/pyside2/tests/util/py3xfunctions.py, but using a simple b'a' instead
      also produces the error.

      When using:
      _
      obj = QFile(self.filename)
      obj.open(QIODevice.ReadOnly)
      print(obj.readAll())
      _
      there is no decoding problem.

      I tried writing the file with Python files instead of os.write() but the problem persisted.
      Also I tried changing the encoding, but I didn't succeed.

      An example temporary file that was written with the test is attached: tmpc8s71kox

       Can someone else confirm it?

       

       

      Attachments

        1. tmpc8s71kox
          0.0 kB
          Cristian Maureira-Fredes
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ctismer Christian Tismer
            crmaurei Cristian Maureira-Fredes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes