Skip to content

[Bug]: incompatible (wrt CPython int's) processing of strings by int() constructor with spaces #1209

Open

Description

@skirpichev

Describe the bug

An example:

Python 3.13.14 (Thu Sep 17 18:51:21 UTC 2026)
[Graal, Oracle GraalVM, Java 25.0.4.1.1 (amd64)] on 'linux'
Type "help", "copyright", "credits" or "license" for more information.
>>> int("\xa0123")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    int("\xa0123")
    ~~~^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '\xa0123'

vs

Python 3.13.15 (tags/v3.13.15:4061bc4c35f, Aug 12 2026, 12:19:57) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> int("\xa0123")  # ignores leading/trailing spaces
123

Operating system

Linux

CPU architecture

x86_64

GraalPy version

25.4.4.1.1

JDK version

No response

Context configuration

No response

Steps to reproduce

See description.

Expected behavior

As in the CPython 3.13.

Stack trace

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions