-
Notifications
You must be signed in to change notification settings - Fork 81
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
destalinator from docker throws an encoding='utf-8' error when using Python 3.6 #161
Comments
That command is for viewing the unit test coverage.You should be able to run I don't think this is related to that traceback, however. From the Python docs (https://docs.python.org/3/library/json.html), it looks like json.loads can take an encoding kwarg, but json.dumps cannot. We're setting encoding for json.dumps here: https://github.com/randsleadershipslack/destalinator/blob/master/slacker.py#L259 That's blocked by a conditional on message_type, but it looks like we're setting that every time we call in. The relevant trace lines are:
|
Ah! Python 2.7 does accept an encoding kwarg here: https://docs.python.org/2/library/json.html @TheConnMan have you ran into this with the docker deployment? |
I just did, yes. I hadn't gotten around to actually running the Dockerized version until today. Dropping the base Docker image down to |
@ahalasz This should be fixed, as the docker image is using python2.7 now. I'm keeping this issue open until we fix 3.6. Thanks for reporting this! |
Thanks it's working now. There is a typo in your Docker file: the Python image should be python:2.7 and not python:alpine2.7 |
Yes, or python:2.7-alpine, though it seems to complain about cffi. Thanks! |
I installed Destalinator as a Docker image, configured the configuration.yaml file with the right slack_name, added the mandatory environment variables in a separate .env file (myvars.env) that I call when I run the container.
Then I noticed that nothing was happening in the Slack channels and the coverage was of 70%.
I thus went in the running Docker container and run ./warner.sh, which gives the following output
I removed the api_token from the above output and changed the slack workspace name.
As you can see it seems like it connect to the desired Slack Workspace, but it throws an error at the end (which might be related to the fact that there are 0 cached messages in the last 30 days?).
I run the docker container with the command
docker run --env-file myvars.env -it -d -p 8080:80 --name=destalinator <image name> sh -c "coverage html --skip-covered && python -m http.server 80"
The text was updated successfully, but these errors were encountered: