ruamel.yaml, big endian failure in yaml.load
ruamel.yaml is a YAML 1.2 parser/emitter for Python
Brought to you by:
anthon
Fails with Big Endian platform
#!/usr/bin/python3
from io import BytesIO
from ruamel.yaml import YAML
yaml = YAML(typ='safe')
f = BytesIO(b"""\
format: multiarch-hints-1.0
hints:
- binary: coinor-libcoinmp-dev
description: coinor-libcoinmp-dev conflicts on ...
link: https://wiki.debian.org/MultiArch/Hints#file-conflict
severity: high
source: coinmp
version: 1.8.3-2+b11
""")
yaml.load(f)
This fails with
Traceback (most recent call last):
File "test.py", line 16, in <module>
yaml.load(f)
File "/usr/lib/python3/dist-packages/ruamel/yaml/main.py", line 343, in load
return constructor.get_single_data()
File "/usr/lib/python3/dist-packages/ruamel/yaml/constructor.py", line 111, in get_single_data
node = self.composer.get_single_node()
File "_ruamel_yaml.pyx", line 701, in _ruamel_yaml.CParser.get_single_node
File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
ruamel.yaml.reader.ReaderError: unacceptable character #x0000: control characters are not allowed
in "<file>", position 244
Can you please have a look? this seems to happen with the 0.16.12 version, please see this downstream bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=962194
thanks for having a look
This is now in the separate ruamel.yaml.clib repository, so reposting this ticket there...