python-ruamel-yaml/0000-fix-big-endian-issues.patch
2023-07-14 00:28:21 +08:00

40 lines
1.0 KiB
Diff

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!
---
main.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/main.py b/main.py
index 9068282..49e70a4 100644
--- a/main.py
+++ b/main.py
@@ -55,7 +55,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,
@@ -70,6 +70,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
--
2.39.1