On Fri, 5 Jun 2020 11:29:55 +0200 Gianfranco Costamagna < locutusofb...@debian.org> wrote: > Hello, > > (this is on zelenka) > > python3 test.py > 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 331, in load > return constructor.get_single_data() > File "/usr/lib/python3/dist-packages/ruamel/yaml/constructor.py", line 109, in get_single_data > node = self.composer.get_single_node() > File "ext/_ruamel_yaml.pyx", line 701, in _ruamel_yaml.CParser.get_single_node > File "ext/_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 > > > So, yes, looks like yaml has an endianess issue? >
I see the cparser is being used. Can you try the same using ruamel.yaml's pure Python parser? https://yaml.readthedocs.io/en/latest/basicuse.html#more-examples from ruamel.yaml import YAML yaml=YAML(typ="safe", pure=True) yaml.load(f) If that works, then we might be able to make a workaround to default to the pure Python version on big endian systems. To be reverted once upstream has a proper fix to the cpython code, of course. Note: ruamel.yaml is mostly a one person (Anthon van der Neut) project, so a fix might take a while. Fans of s390x and other big endian architectures are very welcome to develop a patch! https://yaml.readthedocs.io/en/latest/contributing.html -- Michael R. Crusoe