Subject: bug#71440: Python Inferior Mode Can’t Recognize My Prompt

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jun 2024 19:53:36 +0300

> From: "shynur ." <[email-masked]>
> Date: Sat, 8 Jun 2024 16:29:40 +0000
> msip_labels: 
> 
> I set the ‘PYTHONSTARTUP’ environment variable to a file
> whose content is
> 
> ```python
> import sys
> sys.ps1, sys.ps2 = "\033[32m►\033[0m", "\033[32m▻\033[0m"
> ```
> 
> It works well if I start Python3 in my terminal (Windows
> Terminal, windows11’s built-in app).
> 
> However, if I use it in Emacs:
> 
> 1. open a Python file in Emacs
> 2. type ‘C-c C-p’ (run-python)
> 3. in the buffer visiting the Python file, type ‘C-c C-c’
>    (python-shell-send-buffer)
> 
> Python will throw an error:
> 
> ```
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name '__PYTHON_EL_eval' is not defined

I'm guessing that this is because that #x25ba and #x25bb Unicode
characters don't survive your system codepage (which Emacs uses to
communicate with inferior Python).  What are the values of
w32-ansi-code-page and w32-multibyte-code-page on your system?