python / python/cpython

REPL: unexpected behavior with   (non break space) on Windows

Abierto
#146,046 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

stdlib topic-repl type-bug
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Bug report

Bug description:

Copy " "==" " into Python REPL (the first space is non breakable, you need to generate a new one though), there are two problems I found:

  1. In OS built-in terminal, it is always true
Python 3.13.12 (tags/v3.13.12:1cbe481, Feb  3 2026, 18:22:25) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> " "==" "
True
>>> " "==" " # copied
True
  1. In Vscode integrated terminal, it was false as expected at first. But if you copied from the REPL then, the non break space somehow has changed to normal space, this is the same behavior with the built-in terminal.
Python 3.13.12 (tags/v3.13.12:1cbe481, Feb  3 2026, 18:22:25) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> " "==" "  
False
>>> " "==" " # copied
True

On Linux at least Ubuntu, it behave correctly as expected.

Python 3.12.3 (main, Mar  3 2026, 12:15:18) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> " "==" "
False
>>> " "==" " # copied
False

Based on testing multiple versions, it appears that​ version is not a factor.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce la comparación en la Windows Python REPL usando tanto el terminal integrado en el sistema operativo como el terminal integrado de VS Code, incluido copiar de nuevo la entrada desde la REPL. Empieza siguiendo el manejo de la entrada del terminal de Windows de la REPL y del copiado y pegado. Se considera terminado cuando un espacio de no separación sigue siendo distinto de un espacio normal y la comparación se evalúa sistemáticamente como false.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
cli, operating-systems
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.