Creating new virtualenv fails with cryptic error for project with empty name #5794
Closed
3 tasks done
Labels
kind/bug
Something isn't working as expected
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Linux (Ubuntu 20.04)
Poetry version: 1.2.0b2
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/mlegner/39a29fa3d3678a8aedcde45d215e2897
Issue
When creating a new virtualenv via
poetry env use python
orpoetry add someproject
for a project with an empty name, it fails with the following output:The root of the problem is the
virtualenvs.prompt
option added in #5606: The standard value there,{project_name}-py{python_version}
expands to something like-py3.8
for a project with empty name, which is interpreted as an option in the call tovirtualenv
instead of the value of--prompt
.I suggest to either add a check for an empty name or add quotes for the call to
virtualenv
.The text was updated successfully, but these errors were encountered: