My System:
Ubuntu 14.04
Python 3.6.7
.travis.yml
language: python
python: '3.6'
cache: pip
before_install:
- openssl aes-256-cbc -K $encrypted_721a23b33185_key -iv $encrypted_721a23b33185_iv
-in keyfile.enc -out keyfile -d
install:
- pip install -r requirements.txt
- sudo bash install_gitcrypt.sh
jobs:
include:
- stage: test
name: Tests
script: python manage.py test
before_deploy: git-crypt unlock keyfile
deploy:
provider: script
script: "./zappa_deploy.sh"
on:
all_branches: true
condition: $TRAVIS_BRANCH =~ ^develop|master|travis-test$
Error
$ python manage.py test
Traceback (most recent call last):
File "manage.py", line 22, in <module>
...
File "/home/travis/build/Tarteel-io/tarteel-api/tarteel/settings.py", line 18, in <module>
env.read_env(str(ROOT.path('tarteel/.env')))
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/environ/environ.py", line 635, in read_env
content = f.read()
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xee in position 15: invalid continuation byte
Which can be seen in this build.
Description
I’m running into an issue running the Django test suite for my repo that I can only replicate in the live build on Travis-ci where the python manage.py test
script fails in the test
stage of the jobs matrix.
This issue is similar to this Github Issue. I am able to run python manage.py test
on my local machine in a virtualenv, as well as using the travis-ci-garnet-trusty-1512502259-986baf0
docker image as suggested by the docs.
I also confirmed that the .env
file where the error is pointing to is UTF-8 safe using the isutf8
tool.
Any suggestions on how to proceed?