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

LookupError: 'hex' is not a text encoding; use codecs.encode() #13

Closed
AntouanK opened this issue Jul 2, 2018 · 10 comments
Closed

LookupError: 'hex' is not a text encoding; use codecs.encode() #13

AntouanK opened this issue Jul 2, 2018 · 10 comments
Assignees
Labels

Comments

@AntouanK
Copy link

AntouanK commented Jul 2, 2018

I pulled the latest in the linux vm.

-> % git pull
Updating 20e9888..5332123
Fast-forward
 f5fpc-client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
antouank@antergos-vm [09:53:26] [~/_REPOS_/docker-f5fpc] [master]
-> % sudo ./f5fpc-client.py connect.xxxxxx.com xxxxxxx
Enter your VPN password: 
Traceback (most recent call last):
  File "./f5fpc-client.py", line 155, in <module>
    sys.exit(main())
  File "./f5fpc-client.py", line 63, in main
    'HEXPASSWORD': password.encode('hex')
LookupError: 'hex' is not a text encoding; use codecs.encode() to handle arbitrary codecs

python version

antouank@antergos-vm [09:57:04] [~/_REPOS_/docker-f5fpc] [master]
-> % python --version
Python 3.6.0
antouank@antergos-vm [09:57:08] [~/_REPOS_/docker-f5fpc] [master]
-> % python2 --version
Python 2.7.13
antouank@antergos-vm [09:57:11] [~/_REPOS_/docker-f5fpc] [master]
-> % sudo pip install -r requirements.txt

/usr/lib/python3.6/site-packages/requests/packages/urllib3/contrib/socks.py:31: DependencyWarning: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/latest/contrib.html#socks-proxies
  DependencyWarning
Requirement already satisfied: docker==2.2.1 in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (2.2.1)
Requirement already satisfied: requests==2.11.1 in /usr/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (2.11.1)
Requirement already satisfied: websocket-client>=0.32.0 in /usr/lib/python3.6/site-packages (from docker==2.2.1->-r requirements.txt (line 1)) (0.48.0)
Requirement already satisfied: six>=1.4.0 in /usr/lib/python3.6/site-packages (from docker==2.2.1->-r requirements.txt (line 1)) (1.10.0)
Requirement already satisfied: docker-pycreds>=0.2.1 in /usr/lib/python3.6/site-packages (from docker==2.2.1->-r requirements.txt (line 1)) (0.3.0)

@MatthiasLohr MatthiasLohr changed the title [Arch] script error LookupError: 'hex' is not a text encoding; use codecs.encode() Jul 2, 2018
@MatthiasLohr
Copy link
Owner

Seems to be a python3 compatibility issue, support for hex encoding is gone.

@AntouanK
Copy link
Author

AntouanK commented Jul 2, 2018

@MatthiasLohr Not sure if it would help, but wouldn't it be better to put all the python parts in the docker container?
So you can use an image that has already python installed, and that way you control the version/dependencies, and the user does not have to install some specific python version/library.

@MatthiasLohr
Copy link
Owner

If you take a look into the python code, cou can see that this python script is doing some actions on the host system. So i have no idea how to put that into the container.

@AntouanK
Copy link
Author

AntouanK commented Jul 2, 2018

Oh I see.
I don't know python at all, so I have no idea what it does.

Just curious, by passing the host's network to the container (https://docs.docker.com/network/host/), isn't it enough so you can do all the actions from within the container?

@AntouanK
Copy link
Author

AntouanK commented Jul 2, 2018

In any case, if there's a simple way to fix that error, let me know what I should try.

@AntouanK
Copy link
Author

AntouanK commented Jul 4, 2018

@MatthiasLohr Hey Matthias. Is there any update on this encoding issue?

@MatthiasLohr
Copy link
Owner

Not yet. I will work on that as soon as I find the time for that. Sorry for the delay.

@AntouanK
Copy link
Author

AntouanK commented Jul 5, 2018

No worries at all.
Let me know if I can help testing anything.

Repository owner deleted a comment from AntouanK Jul 10, 2018
Repository owner deleted a comment from AntouanK Jul 10, 2018
@MatthiasLohr MatthiasLohr self-assigned this Jul 10, 2018
@MatthiasLohr
Copy link
Owner

@AntouanK, could you please checkout the new branch and test, if it's working now? Thx!

@AntouanK
Copy link
Author

@MatthiasLohr Yes, I now get the "login denied" error, it doesn't throw the python error anymore. 👍

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

No branches or pull requests

2 participants