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
TypeError: execv() argument 1 must be encoded string without NULL bytes, not str #1
Comments
I should note this is on a RHEL 6.5 Server box while trying to receive a webhook from GitLab 6.5.1 (2ffa03a) |
@n8felton I've only tested this on python2.7. It looks like the clone is failing for some reason. Is the git repository an ascii string? If it isn't, it could convert the entire command to be a unicode string. Could you modify the python code to also log what |
Looks like a Python 2.6.6 issue. I complied and ran with Python 2.7.6 and it worked just fine. Thanks for the quick reply though! |
This looks like a bug with shlex in older versions of Python. I was able to solve it by changing line 128-129 (at least in the current master version) to the following (change is to the shlex portion): process = subprocess.Popen(shlex.split(command.encode('ascii')), stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) I'm successfully using this on RHEL 6.5 with stock Python 2.6. I did have to install argparse, but this can be done with "yum install python-setuptools ; easy_install pip ; pip install argparse" or you can download the tarball and "python setup.py install" it. |
Thanks @romracer. I've made the fix to the master branch. |
An issue with unicode strings in python 2.4 and 2.6 (and possibly 2.5) prevents shlex to split the command which leads to the daemon or task not starting. The unicode issue seems to be fixed in python 2.7. The exact error message is: "TypeError: execv() argument 1 must be (encoded string without NULL bytes), not str". See: vinodc/gitlab-webhook-branch-deployer#1
I'm not sure if anyone is still watching this, but I've run into an issue and I'm still not very good with Python.
Any help you might be able to provide would be great.
The text was updated successfully, but these errors were encountered: