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

pexpect.spawn does not support Windows #492

Open
fcollonval opened this issue Dec 7, 2019 · 8 comments
Open

pexpect.spawn does not support Windows #492

fcollonval opened this issue Dec 7, 2019 · 8 comments

Comments

@fcollonval
Copy link
Member

Per the documentation, the currently used pexpect.spawn to handle git authentication does not support Windows:
https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows

For Windows, they recommand:

Pexpect can be used on Windows to wait for a pattern to be produced by a child process, using pexpect.popen_spawn.PopenSpawn, or a file descriptor, using pexpect.fdpexpect.fdspawn.

@ktaletsk
Copy link
Contributor

ktaletsk commented Dec 9, 2019

Documentation also says "PopenSpawn is not a direct replacement for spawn". That suggests to me that we would need to add separate implementation of GitAuthInputWrapper for Windows. Any thoughts on that? I am willing to help if needed.

@fcollonval
Copy link
Member Author

@ktaletsk thank you for kicking in. Any help would be appreciated 😄

Your proposal to handle Windows specifically is fine for me.

@jaipreet-s
Copy link
Member

This would also be a good opportunity to start adding integration testing + testing on windows in the CI setup

  1. Integration Testing: Use the server REST API to perform Git push/pull actions against a test Git repository
  2. CI: Run these tests across Windows and Linux. Looks like travis supports Windows now so we may not have to overhaul the CI setup

@fcollonval
Copy link
Member Author

Some simple example of using GIT_ASKPASS to set username and password from environment variables (for Linux): https://stackoverflow.com/questions/68344358/git-askpass-with-user-and-password

@Conor-Smith1
Copy link

I'm still getting this error:

Traceback (most recent call last): File "C:\Users\conor\anaconda3\lib\site-packages\jupyterlab_git\git.py", line 135, in execute code, output, error = await call_subprocess_with_authentication( File "C:\Users\conor\anaconda3\lib\site-packages\jupyterlab_git\git.py", line 71, in call_subprocess_with_authentication p = pexpect.spawn( AttributeError: module 'pexpect' has no attribute 'spawn'

Has the pexpect issue not been resolved, meaning this cannot be used in Windows?

@fcollonval
Copy link
Member Author

For now the handling of authentication by the extension is not working on Windows due to the limitation you are mentioning (reference issue #492).

One way to solve it is to set up a credential helper to deal with the authentication for you. For that you will need to use Git for Windows. Then I think, it will work out of the box and prompt with a dialog if your credentials are required.

Originally posted at #1085 (comment)

@Conor-Smith1
Copy link

Ok, I ended up having to just push from Git for Windows and do all other operations in JupyterLab. A little annoying, but not too bad. Having used this functionality on Linux it is quite nice, hopefully it comes to Windows some day. Thanks for the help!

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

No branches or pull requests

4 participants