Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinError using pipenv in Pypy #52

Open
Aareon opened this issue May 4, 2021 · 1 comment
Open

WinError using pipenv in Pypy #52

Aareon opened this issue May 4, 2021 · 1 comment

Comments

@Aareon
Copy link

Aareon commented May 4, 2021

When trying to install any package or execute any pipenv sub-command, pipenv fails with [WinError 6] The handle is invalid

Aareon@DESKTOP-K5VQOE1 MINGW64 /i/StaSH2 (master)
$ pipenv install dearpygui
Traceback (most recent call last):
  File "i:\programs\pypy3.7-v7.3.4-win64\lib-python\3\runpy.py", line 196, in _r
un_module_as_main
    "__main__", mod_spec)
  File "i:\programs\pypy3.7-v7.3.4-win64\lib-python\3\runpy.py", line 85, in _ru
n_code
    exec(code, run_globals)
  File "I:\Programs\pypy3.7-v7.3.4-win64\Scripts\pipenv.exe\__main__.py", line 4
, in <module>
    from pipenv import cli
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\__init__.py", line
 55, in <module>
    from .cli import cli
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\cli\__init__.py",
line 4, in <module>
    from .command import cli    # noqa
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\cli\command.py", l
ine 13, in <module>
    from ..exceptions import PipenvOptionsError
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\exceptions.py", li
ne 14, in <module>
    from .patched import crayons
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\patched\crayons.py
", line 49, in <module>
    is_powershell = "powershell" in shellingham.detect_shell()[0]
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\__init__.py", line 22, in detect_shell
    shell = get_shell(pid, max_depth=max_depth)
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\nt.py", line 111, in get_shell
    processes = dict(_iter_process())
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\nt.py", line 77, in _iter_process
    raise WinError()
OSError: [WinError 6] The handle is invalid

Issue description

Using latest Pypy3, but I doubt that has anything to do with my issue as I am able to install packages perfectly fine with other terminal emulators (Windows Terminal, Powershell) & Pipenv.

Expected result

Expected packages (ex. flake8) to install w/o error in Git Bash as they do in any other terminal.

Actual result

[WinError 6] The handle is invalid

Steps to replicate

  • Using Git Bash, install pipenv w/ py -m pip install pipenv -U
  • Attempt to install any package (ex. flake8) w/ pipenv install flake8
  • Observe error.

pipenv --support result:

$ pipenv --support
Traceback (most recent call last):
  File "i:\programs\pypy3.7-v7.3.4-win64\lib-python\3\runpy.py", line 196, in _r
un_module_as_main
    "__main__", mod_spec)
  File "i:\programs\pypy3.7-v7.3.4-win64\lib-python\3\runpy.py", line 85, in _ru
n_code
    exec(code, run_globals)
  File "I:\Programs\pypy3.7-v7.3.4-win64\Scripts\pipenv.exe\__main__.py", line 4
, in <module>
    from pipenv import cli
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\__init__.py", line
 55, in <module>
    from .cli import cli
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\cli\__init__.py",
line 4, in <module>
    from .command import cli    # noqa
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\cli\command.py", l
ine 13, in <module>
    from ..exceptions import PipenvOptionsError
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\exceptions.py", li
ne 14, in <module>
    from .patched import crayons
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\patched\crayons.py
", line 49, in <module>
    is_powershell = "powershell" in shellingham.detect_shell()[0]
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\__init__.py", line 22, in detect_shell
    shell = get_shell(pid, max_depth=max_depth)
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\nt.py", line 111, in get_shell
    processes = dict(_iter_process())
  File "i:\programs\pypy3.7-v7.3.4-win64\site-packages\pipenv\vendor\shellingham
\nt.py", line 77, in _iter_process
    raise WinError()
OSError: [WinError 6] The handle is invalid
@uranusjr
Copy link
Member

uranusjr commented May 6, 2021

Could you try if the master branch works for you?

$ git clone https://github.com/sarugaku/shellingham.git
$ cd shellingham/src
$ pypy3  # Or however you run the PyPy 3.7 installation in question.
>>> import shellingham
>>> shellingham.detect_shell()

There’s recently a substential rewrite on the Windows logic and I’m curious whether the new implementation still has the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants