Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,209 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, python
Ambito
backend

Direzione di ricerca

The bug is in how GraalPy's int() constructor parses strings: a leading non-breaking space (\xa0) makes it raise ValueError, while CPython 3.13 strips it. Start by reproducing int("\xa0123") on GraalPy and comparing it with CPython's whitespace handling for int(). Done when int("\xa0123") returns 123, matching CPython 3.13, and the change is covered by a test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
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

Lingua principale
Python
Stelle
1.7k
Fork
156
Merge medio
5h 11m
PR unite (30g)
51

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oracle/graalpython

Tutte le issue di oracle/graalpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.