Closed tjj5036 closed 7 years ago
I have this error in pylxd, when the default path is %2Fvar%2Flib%2Flxd%2Funix.socket
- I don't think length has anything to do with the issue. In fact, something requests 2.12 is what is causing the issue. As long as I use a requests <2.12
, I don't have the issue at all.
There were problems with requests
relating to their IDNA encoding that were since fixed (see https://github.com/msabramo/httpie-unixsocket/issues/10#issuecomment-280892450). You might want to try this again with the latest version of requests
. I don't think there's anything that I can do in this project to help with this issue.
I ran into an issue where I had a path to a socket that looked like this:
Which is 73 characters long. When prefixed with
http+unix
, the full path looks like:When passed to requests, the following error occurs:
Which is in turn triggered by this:
Digging around in the source for
models.py
, it looks like it extracts the host (which is the path to the socket above), and then performs:host = host.encode('idna').decode('utf-8')
This will fail in accordance with the IDNA RFC, which states:
My interpretation of the error is that if the path to the socket is rather long, this fails. Is there a suggested workaround other than symlinking the socket file to something short?