Open papparotzi opened 5 years ago
It looks like requests is insisting on encoding the password in Latin-1. I don't know if Latin-1 is needed as part of the relevant protocol, but whether it is or not, this looks like a requests issue. I suggest you raise it with them - it might help them diagnose the issue if you can reproduce the problem with "plain" requests rather than via pip, but if not, there should still be enough in this traceback for them.
Thanks for your response, I will create an account and raise an issue with them.
It looks like requests might require a byte string to be passed in this case, instead of Unicode: https://github.com/requests/requests/issues/3662
It is probably safe to assume that the encoding of credential fields should be UTF-8 as:
I think it would be OK for us to always extract and encode these fields before passing them to requests.
I tested the change with our corporate proxy and it works now with UTF8 passwords. Please accept PR
This issue is an vendor issue and depends on: https://github.com/psf/requests/issues/4564 Only after this issues fixed and released, the pip issue can be closed due to updating the vendored requests libary (see https://pip.pypa.io/en/latest/development/vendoring-policy/)
Hi @CarliJoy, we should be able to do this in pip itself as long as we do the encoding before passing the username and password to requests. This is the workaround described in psf/requests#4564.
Environment
Description
When attempting to install or even update anything with pip I get the old UnicodeEncodeError Expected behavior
To work. How to Reproduce
Output
My password does have a special character in it, which is a requirement of the business. I have environment variables for http/https proxy, I have also tried installing while passing the proxy in the command itself and get the same output. I have tried changing the charset in my command window which did not work. There are no spaces in my top level Python folder as one can see from the output. Everything I and finding on the net is regarding charset or outdated software versions. Any help you can give would be appreciated. Thank you.