View Issue Details

IDProjectCategoryView StatusLast Update
0010769Talerwallet-corepublic2025-12-12 16:25
Reporterhtgoebel Assigned To 
PrioritynormalSeveritytrivialReproducibilityN/A
Status newResolutionopen 
Summary0010769: [patch] Make taler-helper-sqlite3 run with Python 3.10
DescriptionEnclosed please find the respective patch.
Additional InformationQuite some test-suites out there are testing their applications using older versions of Python. E.g. tryton 7.0 (more precisly its account_payment_taler module) is tested for Python 3.8 on.

(ATM I don't have the taler-waller-cli integrated into the c\ccount_payment_taler test-suite, thus I did only check fot Python 3.10. I may add another patch later lowering the barrier even more.)
TagsNo tags attached.
Attached Files
taler-helper-sqlite3.patch (3,048 bytes)   
--- packages/idb-bridge/taler-helper-sqlite3.orig	2025-12-12 14:59:51.162073192 +0100
+++ packages/idb-bridge/taler-helper-sqlite3	2025-12-12 16:14:34.042700490 +0100
@@ -18,14 +18,10 @@
 import sys
 import os
 
-v = sys.version_info
-if v.major < 3 or (v.major == 3 and v.minor < 11):
-    print(
-        "FATAL: python version >=3.11 required but running on",
-        sys.version,
-        file=sys.stderr,
-    )
-    sys.exit(1)
+if sys.version_info < (3, 10):
+    raise SystemExit(
+        "FATAL: python version >=3.10 required but running on %s" %
+        sys.version)
 
 print("started sqlite3 helper at", os.getcwd(), file=sys.stderr)
 
@@ -75,9 +71,9 @@
 def write_resp(req_id, cmd, payload=None):
     trace("sending response to request", req_id)
     outlen = 4 + 4 + 1 + (0 if payload is None else len(payload))
-    respstream.write(outlen.to_bytes(4))
-    respstream.write(req_id.to_bytes(4))
-    respstream.write(cmd.to_bytes(1))
+    respstream.write(outlen.to_bytes(4, byteorder='big'))
+    respstream.write(req_id.to_bytes(4, byteorder='big'))
+    respstream.write(cmd.to_bytes(1, byteorder='big'))
     if payload is not None:
         respstream.write(payload)
     respstream.flush()
@@ -103,16 +99,16 @@
         self.chunks.append(buf)
 
     def write_uint8(self, n):
-        self.chunks.append(n.to_bytes(1))
+        self.chunks.append(n.to_bytes(1, byteorder='big'))
 
     def write_uint32(self, n):
-        self.chunks.append(n.to_bytes(4))
+        self.chunks.append(n.to_bytes(4, byteorder='big'))
 
     def write_uint16(self, n):
-        self.chunks.append(n.to_bytes(2))
+        self.chunks.append(n.to_bytes(2, byteorder='big'))
 
     def write_int64(self, n):
-        self.chunks.append(n.to_bytes(8, signed=True))
+        self.chunks.append(n.to_bytes(8, byteorder='big', signed=True))
 
     def write_rowlist(self, rows, description):
         self.write_uint16(len(rows))
@@ -164,17 +160,17 @@
         return d
 
     def read_uint16(self):
-        d = int.from_bytes(self.data[self.pos : self.pos + 2])
+        d = int.from_bytes(self.data[self.pos : self.pos + 2], byteorder='big')
         self.pos += 2
         return d
 
     def read_uint32(self):
-        d = int.from_bytes(self.data[self.pos : self.pos + 4])
+        d = int.from_bytes(self.data[self.pos : self.pos + 4], byteorder='big')
         self.pos += 4
         return d
 
     def read_int64(self):
-        d = int.from_bytes(self.data[self.pos : self.pos + 8], signed=True)
+        d = int.from_bytes(self.data[self.pos : self.pos + 8], byteorder='big', signed=True)
         self.pos += 8
         return d
 
@@ -228,8 +224,8 @@
         sys.exit(0)
     elif len(buf_sz) != 4:
         raise Exception("incomplete message")
-    size = int.from_bytes(buf_sz)
-    req_id = int.from_bytes(read_exactly(4))
+    size = int.from_bytes(buf_sz, byteorder='big')
+    req_id = int.from_bytes(read_exactly(4), byteorder='big')
     rest = read_exactly(size - 8)
     pr = PacketReader(rest)
     cmd = pr.read_uint8()
taler-helper-sqlite3.patch (3,048 bytes)   

Activities

Issue History

Date Modified Username Field Change
2025-12-12 16:25 htgoebel New Issue
2025-12-12 16:25 htgoebel File Added: taler-helper-sqlite3.patch