Different QLocale.decimalPoint values, little-endian (amd64, arm64, etc) vs. big-endian (s390x)

Dmitry Shachnev mitya57 at ubuntu.com
Wed May 21 12:38:09 BST 2025


Hi,

Forwarding a bug report that I received in Debian [1].

The following code correctly returns a comma on little endian systems:

    >>> from PyQt6.QtCore import QLocale
    >>> QLocale(QLocale.Language.Dutch, QLocale.Script.LatinScript, QLocale.Country.Netherlands).decimalPoint()
    ','

But on big endian systems it returns a dot:

    >>> from PyQt6.QtCore import QLocale
    >>> QLocale(QLocale.Language.Dutch, QLocale.Script.LatinScript, QLocale.Country.Netherlands).decimalPoint()
    '.'

And an equivalent C++ program consistenly returns comma on both platforms:

    #include <QtCore/QLocale>
    #include <QtCore/QTextStream>

    int main() {
        QTextStream(stdout) << QLocale(QLocale::Dutch, QLocale::LatinScript, QLocale::Netherlands).decimalPoint() << Qt::endl;
        return 0;
    }

Also, it works fine with PyQt5 and PySide6.

Package versions:

- PyQt6 v6.9.0
- SIP v6.10.0
- PyQt-builder v1.18.1

I have access to a big endian box so I can test a potential patch if needed.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088101

--
Dmitry Shachnev


More information about the PyQt mailing list