2022-05-20 10:17:46 +08:00
|
|
|
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!
|
2023-07-07 08:15:03 +08:00
|
|
|
---
|
|
|
|
|
main.py | 7 ++++++-
|
|
|
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
2022-05-20 10:17:46 +08:00
|
|
|
|
2023-07-07 08:15:03 +08:00
|
|
|
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:
|
2022-05-20 10:17:46 +08:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
2023-07-07 08:15:03 +08:00
|
|
|
--
|
|
|
|
|
2.39.1
|
|
|
|
|
|