Fix python 2 crash when reading config file

This commit is contained in:
JonasT 2019-01-16 21:55:15 +01:00 committed by GitHub
parent c66af5dc0b
commit be52c21467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,10 @@ class Buildozer(object):
self.config.getrawdefault = self._get_config_raw_default
if exists(filename):
self.config.read(filename, "utf-8")
try:
self.config.read(filename, "utf-8")
except TypeError: # python 2 has no second arg here
self.config.read(filename)
self.check_configuration_tokens()
# Check all section/tokens for env vars, and replace the