[PyQt] bug in pyqt's configure.py

Mathias.Born at gmx.de Mathias.Born at gmx.de
Mon Jan 21 23:11:07 GMT 2013


Hi,

In the latest snapshot (PyQt-win-gpl-snapshot-4.10-f0118624625e.zip),
I noticed an error in its configure.py when run on Python 3.3.

lines 1925 to 1931 read:

        # Qt5 doesn't have the 'default' link.
        if not os.path.isdir(fname):
            f = get_command_stdout(opts.qmake + " -query QMAKE_SPEC")
            fname = f.read().strip()
            f.close()

            fname = os.path.join(qt_datadir, "mkspecs", fname)

The problem here is that

            fname = f.read().strip()

creates a byte array, not a string, which makes

            fname = os.path.join(qt_datadir, "mkspecs", fname)

fail, because qt_datadir is a string.


These possible fixes come to my mind:

(1) Just add "decode" to the reading:

             fname = f.read().strip().decode()

(2) Change function "get_command_stdout" in line 1401:

    p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, stderr=stderr, env=env, universal_newlines=True)

  However, this most likely will break other parts.


Best Regards,
Mathias Born




More information about the PyQt mailing list