Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?

Regression in django-environ==0.4.2

Value of env.bool('DEBUG') given DEBUG=1 changes between 0.4.1 and 0.4.2. Tested under Python 3.6.

To reproduce:

docker-compose up

Example output:

Starting djangoenvironregression_environ041_1
Starting djangoenvironregression_environ042_1
Attaching to djangoenvironregression_environ042_1, djangoenvironregression_environ041_1
environ042_1  | DEBUG False
environ041_1  | DEBUG True
djangoenvironregression_environ042_1 exited with code 0
djangoenvironregression_environ041_1 exited with code 0
version: '2'
services:
environ041:
build:
context: .
dockerfile: Dockerfile.041
environment:
DEBUG: 1
environ042:
build:
context: .
dockerfile: Dockerfile.042
environment:
DEBUG: 1
FROM python:3.6
RUN pip install django-environ==0.4.1
COPY test.py /usr/src/app/test.py
CMD ["python", "/usr/src/app/test.py"]
FROM python:3.6
RUN pip install django-environ==0.4.2
COPY test.py /usr/src/app/test.py
CMD ["python", "/usr/src/app/test.py"]
import environ
env = environ.Env()
print('DEBUG', env.bool('DEBUG', default=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment