-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Description
- [x ] I am on the latest Poetry version.
- [ x] 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 (
-vvvoption).
- OS version and name: macOS 10.15.5
- Poetry version: 1.0.9
- Link of a Gist with the contents of your pyproject.toml file: pyproject.toml
Issue
I recently switched back to tcsh from bash and found that poetry shell now fails to activate the python virtual environment.
ejo@ufo:blynclight -> poetry --version
Poetry version 1.0.9
ejo@ufo:blynclight -> poetry shell
Spawning shell within /Users/ejo/Library/Caches/pypoetry/virtualenvs/blynclight-JhnzrnPE-py3.7
ejo@ufo:blynclight -> . /Users/ejo/Library/Caches/pypoetry/virtualenvs/blynclight-JhnzrnPE-py3.7/bin/activate
/usr/bin/.: Permission denied.
ejo@ufo:blynclight -> echo $shlvl
2The $shlvl variable indicates that a new shell was invoked, but the errors indicate that the virtual environment was not properly activated.
It appears that poetry shell is attempting to use the bash method of activating the virtual environment which does not work for tcsh (as expected).
Inspection of the two methods:
poetry.utils.shell.Shell._get_activate_scriptpoetry.utils.shell.Shell._get_source_command
show explicit checks for csh and fish but not tcsh.
When the user's shell is tcsh, both of those methods will mis-identify the shell as bash and it all ends badly.
I submitted PR #2583 which expands the explicit checking done in those methods to include tcsh and lumps handling for csh and tcsh together.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected