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

ProtocolError while using pip (OSError 22 Invalid argument) #10500

Closed
Kiolali opened this issue Sep 22, 2021 · 6 comments
Closed

ProtocolError while using pip (OSError 22 Invalid argument) #10500

Kiolali opened this issue Sep 22, 2021 · 6 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@Kiolali
Copy link

Kiolali commented Sep 22, 2021

Description

If I try to install a package via pip or try to upgrade pip (python -m pip install --upgrade pip) it fails (see output below).

With Python 3.6 I do not have any problems. I also tried Python 3.8, which has the same behavior than Python 3.9 (32 and 64-bit version).

Deactivating IPV6 did not work. Calling pip install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com as written here (#9216 (comment)) also works for me but is not a solution.

Expected behavior

pip is updated.

pip version

21.2.3

Python version

3.9.7

OS

Windows 10, 64-bit

How to Reproduce

  1. open a terminal
  2. call python -m pip install --upgrade pip

Output

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(22, 'Invalid argument'))': /simple/pip/


### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).
@Kiolali Kiolali added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Sep 22, 2021
@DiddiLeija
Copy link
Member

@Kiolali I tried to reproduce this using a Windows 10 terminal with Python 3.9, but I din't get any errors. Do you have a specific configuration here?

@Kiolali
Copy link
Author

Kiolali commented Sep 22, 2021

I can't reproduce it myself either. I also tried with another Windows 10 Laptop in the same network. It works on the other machine.
I do not have a specific configuration.

@Kiolali
Copy link
Author

Kiolali commented Sep 22, 2021

I also tried pip search validate. Part of the output is the following:
OSError: [Errno 22] Invalid argument: '\u202aC:\\Users\\xxx\\Desktop\\sslkeylog.log'

On the following page https://docs.python.org/3/library/ssl.html is written:
"Changed in version 3.8: Support for key logging to SSLKEYLOGFILE was added."

Any ideas what could be wrong?

@DiddiLeija
Copy link
Member

Well, you should not be able to run pip search, since the XMLRPC was disabled on PyPI.org.

On the following page https://docs.python.org/3/library/ssl.html is written:
"Changed in version 3.8: Support for key logging to SSLKEYLOGFILE was added."

Any ideas what could be wrong?

This could be related, but I'm not sure at all. Maybe your sslkeylog.log is invalid?

@pfmoore
Copy link
Member

pfmoore commented Sep 22, 2021

That \u202a appears to be Left-To-Right Embedding. I suspect you have C:\Users\xxx\Desktop\sslkeylog.log in a config file somewhere but it's got that (invisible) extra character included by accident somehow.

@Kiolali
Copy link
Author

Kiolali commented Sep 22, 2021

Well, you should not be able to run pip search, since the XMLRPC was disabled on PyPI.org.

I know, but the error message was quite helpful (in contrast to the command pip install x). I could resolve my problem by deleting the environment variable SSLKEYLOGFILE. I really have no idea how this variable was set. My other laptop doesn't have that variable.

@Kiolali Kiolali closed this as completed Sep 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2021
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants