summaryrefslogtreecommitdiffstats
path: root/debian/patches/big_endian
blob: 2f617f0cfadd967fa399a106ffec17ce3bec0527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Author: Michael R. Crusoe <crusoe@debian.org>
Description: Default to pure python parsing on big endian systems
Forwarded: not-needed

As the cpython code has an endianness bug https://sourceforge.net/p/ruamel-yaml/tickets/360/

Thanks to Rebecca N. Palmer for the tip about sys.byteorder!

Index: ruamel.yaml/main.py
===================================================================
--- ruamel.yaml.orig/main.py
+++ ruamel.yaml/main.py
@@ -58,7 +58,7 @@ class YAML:
         self: Any,
         *,
         typ: Optional[Union[List[Text], Text]] = None,
-        pure: Any = False,
+        pure: Any = None,
         output: Any = None,
         plug_ins: Any = None,
     ) -> None:  # input=None,
@@ -75,6 +75,11 @@ class YAML:
         """
 
         self.typ = ['rt'] if typ is None else (typ if isinstance(typ, list) else [typ])
+        if pure is None:
+            if sys.byteorder == 'big':
+                pure = True
+            else:
+                pure = False
         self.pure = pure
 
         # self._input = input