You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using Poetry on Windows 11 in Portuguese, the generated .cmd files for scripts defined in [project.scripts] contain paths with accented characters that are incorrectly encoded. As a result, when executing the command, the system is unable to locate the specified path.
Execution:
Activate the virtual environment and run:
say-hello "Word"
Expected Result:
The command say-hello "Word" should invoke the defined script, displaying the message Hello, Word or the corresponding behavior.
Observed Result:
The command fails with the following error message:
O sistema não pode encontrar o caminho especificado.
Translate:
The system cannot find the specified path.
Upon inspecting the file .venv\Scripts\say-hello.cmd (after removing the @echo off to view the commands), the content is as follows:
"C:\Users\jmoni\OneDrive\├ürea de Trabalho\scripts\clis-pyproject\example\.venv\Scripts\python.exe" "C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Scripts\\say-hello"
It can be observed that the folder Área de Trabalho appears as ├ürea de Trabalho, indicating an encoding issue with accented characters.
Additional Notes:
The problem seems to be related to how Poetry generates the .cmd files, not correctly handling the encoding of special characters present in the paths.
This error occurs specifically in environments with the Portuguese locale (Windows 11 PT-BR).
Workarounds
To work around the issue with locating the .cmd executable due to incorrect encoding of accented characters on Windows, you can modify the file .venv\Scripts\say-hello.cmd by adding the following line at the beginning of the file:
chcp65001>nul
This line changes the code page. Although this solution works for this specific case, it may not be suitable as a universal fix for all scenarios.
Loading configuration file C:\Users\jmoni\AppData\Roaming\pypoetry\config.toml
Trying to detect current active python executable as specified in the config.
Found: C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Scripts\python.EXE
Using virtualenv: C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv
Installing dependencies from lock file
Finding the necessary packages for the current system
Package operations: 0 installs, 0 updates, 0 removals, 9 skipped
- Installing click (8.1.8): Pending...
- Installing click (8.1.8): Skipped for the following reason: Already installed
- Installing colorama (0.4.6): Pending...
- Installing colorama (0.4.6): Skipped for the following reason: Already installed
- Installing markdown-it-py (3.0.0): Pending...
- Installing markdown-it-py (3.0.0): Skipped for the following reason: Already installed
- Installing mdurl (0.1.2): Pending...
- Installing mdurl (0.1.2): Skipped for the following reason: Already installed
- Installing rich (13.9.4): Pending...
- Installing rich (13.9.4): Skipped for the following reason: Already installed
- Installing shellingham (1.5.4): Pending...
- Installing shellingham (1.5.4): Skipped for the following reason: Already installed
- Installing typer (0.15.1): Pending...
- Installing typer (0.15.1): Skipped for the following reason: Already installed
- Installing pygments (2.19.1): Pending...
- Installing pygments (2.19.1): Skipped for the following reason: Already installed
- Installing typing-extensions (4.12.2): Pending...
- Installing typing-extensions (4.12.2): Skipped for the following reason: Already installed
Installing the current project: example (0.1.0)
- Building package example in editable mode
- Removed example-0.1.0.dist-info directory from C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Lib\site-packages
- Adding example.pth to C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Lib\site-packages for C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example
- Adding the say-hello script to C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Scripts
- Adding the say-hello.cmd script wrapper to C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Scripts
- Adding the example-0.1.0.dist-info directory to C:\Users\jmoni\OneDrive\Área de Trabalho\scripts\clis-pyproject\example\.venv\Lib\site-packages
The text was updated successfully, but these errors were encountered:
Description
Description:
When using Poetry on Windows 11 in Portuguese, the generated
.cmd
files for scripts defined in[project.scripts]
contain paths with accented characters that are incorrectly encoded. As a result, when executing the command, the system is unable to locate the specified path.Steps to Reproduce:
Project Structure:
Contents of
example/cli.py
:Contents of
pyproject.toml
:Execution:
Activate the virtual environment and run:
say-hello "Word"
Expected Result:
The command
say-hello "Word"
should invoke the defined script, displaying the messageHello, Word
or the corresponding behavior.Observed Result:
The command fails with the following error message:
Translate:
Upon inspecting the file
.venv\Scripts\say-hello.cmd
(after removing the@echo off
to view the commands), the content is as follows:It can be observed that the folder
Área de Trabalho
appears asÁrea de Trabalho
, indicating an encoding issue with accented characters.Additional Notes:
.cmd
files, not correctly handling the encoding of special characters present in the paths.Workarounds
To work around the issue with locating the
.cmd
executable due to incorrect encoding of accented characters on Windows, you can modify the file.venv\Scripts\say-hello.cmd
by adding the following line at the beginning of the file:This line changes the code page. Although this solution works for this specific case, it may not be suitable as a universal fix for all scenarios.
Poetry Installation Method
pipx
Operating System
Windows 11
Poetry Version
2.0.1
Poetry Configuration
Python Sysconfig
sysconfig.log
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
poetry -vvv installThe text was updated successfully, but these errors were encountered: