Skip to content

on aarch64_be: Strings are byteswapped after python parser encouters UTF-8 #137204

@neuschaefer

Description

@neuschaefer

Bug report

Bug description:

Background:

aarch64_be is 64-bit Arm, but in big-endian mode. Both Linux and NetBSD support aarch64_be.

Steps to reproduce:

  • Obtain a aarch64_be toolchain, for example with Buildroot
  • Build python for aarch64_be
  • run printf '# \xe2\x94\x80\n\nraise RuntimeError()' > a.py && python3 a.py
# ─

raise RuntimeError()

Output:

Traceback (most recent call last):
  File "/root/a.py", line 3, in <module>
    riaesR nuitemrEorr()
RuntimeError

The line of source code reported in the traceback exhibits the described problem. This issue also leads to a lot of test failures.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

TODO

  • check other python versions than 3.13
  • check other compilers than gcc 14

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions