Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package liblouis for openSUSE:Factory checked in at 2024-04-25 20:47:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/liblouis (Old) and /work/SRC/openSUSE:Factory/.liblouis.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "liblouis" Thu Apr 25 20:47:46 2024 rev:55 rq:1170055 version:3.25.0 Changes: -------- --- /work/SRC/openSUSE:Factory/liblouis/liblouis.changes 2024-04-12 17:34:07.522294557 +0200 +++ /work/SRC/openSUSE:Factory/.liblouis.new.1880/liblouis.changes 2024-04-25 20:47:55.663316064 +0200 @@ -1,0 +2,7 @@ +Mon Apr 22 16:00:03 UTC 2024 - Daniel Garcia <[email protected]> + +- Add s390x-support.patch to fix issues with python bindings on big + endian machines. + (gh#liblouis/liblouis#1552, bsc#1198348) + +------------------------------------------------------------------- New: ---- s390x-support.patch BETA DEBUG BEGIN: New: - Add s390x-support.patch to fix issues with python bindings on big endian machines. BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ liblouis.spec ++++++ --- /var/tmp/diff_new_pack.DHtuR2/_old 2024-04-25 20:47:56.287338978 +0200 +++ /var/tmp/diff_new_pack.DHtuR2/_new 2024-04-25 20:47:56.287338978 +0200 @@ -25,6 +25,8 @@ Group: Productivity/Other URL: http://liblouis.io/ Source0: https://github.com/liblouis/liblouis/releases/download/v%{version}/liblouis-%{version}.tar.gz +# PATCH-FIX-UPSTREAM s390x-support gh#liblouis/liblouis#1552 bsc#1198348 +Patch0: s390x-support.patch BuildRequires: fdupes BuildRequires: libyaml-devel BuildRequires: pkgconfig ++++++ s390x-support.patch ++++++ >From e11dfbc7539e31be5e4381e416874ad22e408502 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno <[email protected]> Date: Thu, 11 Apr 2024 13:35:03 +0200 Subject: [PATCH] python: use utf_%d_be encoding on bigendian archs Fix https://github.com/liblouis/liblouis/issues/1551 --- python/louis/__init__.py.in | 5 +++-- python/tests/test_louis.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) Index: liblouis-3.25.0/python/louis/__init__.py.in =================================================================== --- liblouis-3.25.0.orig/python/louis/__init__.py.in +++ liblouis-3.25.0/python/louis/__init__.py.in @@ -39,7 +39,7 @@ function for information about how liblo @author: Andre-Abush Clause <[email protected]> """ -from sys import getfilesystemencoding, platform, version_info +from sys import byteorder, getfilesystemencoding, platform, version_info from atexit import register from ctypes import ( c_ushort, @@ -60,6 +60,7 @@ except ImportError: # Unix/Cygwin _loader, _functype = cdll, CFUNCTYPE liblouis = _loader["###LIBLOUIS_SONAME###"] _is_windows = platform == "win32" +_endianness = "be" if byteorder == "big" else "le" # { Module Configuration #: Specifies the charSize (in bytes) used by liblouis. @@ -78,7 +79,7 @@ outlenMultiplier = 4 + wideCharBytes * 2 fileSystemEncoding = "mbcs" if _is_windows else getfilesystemencoding() #: Specifies the encoding to use when converting from byte strings to unicode strings. #: @type: str -conversionEncoding = "utf_%d_le" % (wideCharBytes * 8) +conversionEncoding = "utf_%d_%s" % (wideCharBytes * 8, _endianness) # } # Some general utility functions Index: liblouis-3.25.0/python/tests/test_louis.py =================================================================== --- liblouis-3.25.0.orig/python/tests/test_louis.py +++ liblouis-3.25.0/python/tests/test_louis.py @@ -96,5 +96,21 @@ class TestUnicodeDecomposed(unittest.Tes def test_14(self): self.assertEqual(louis.translateString(["en-ueb-g1.ctb", "tests/test.cti"], "a \ud83e\udd23 b"), 'a "<rolling on the floor laughing"> b') + +class TestEndianness(unittest.TestCase): + def test_1(self): + self.assertEqual(louis.translate(["unicode.dis","en-chardefs.cti"], "abcdefghijklmnopqrstuvwxyz")[0], + "â â â â â â â â â â â â â â â â â â â â ⠥⠧⠺â ⠽⠵") + + def test_2(self): + # invert encoding + _encoding = louis.conversionEncoding + _endianness = "le" if louis._endianness == "be" else "be" + louis.conversionEncoding = "utf_%d_%s" % (louis.wideCharBytes * 8, _endianness) + with self.assertRaises(UnicodeDecodeError) as context: + self.assertEqual(louis.translate(["unicode.dis","en-chardefs.cti"], "abcdefghijklmnopqrstuvwxyz")[0], + "â â â â â â â â â â â â â â â â â â â â ⠥⠧⠺â ⠽⠵") + louis.conversionEncoding = _encoding + if __name__ == '__main__': unittest.main()
