test/wcs: read/write files in binary mode when pickling (#38781)

This commit is contained in:
Emmanuel Cazenave 2020-01-23 06:49:22 +01:00
parent 85676130c2
commit 723b1e532a
1 changed files with 2 additions and 2 deletions

View File

@ -172,12 +172,12 @@ class WcsHost(object):
def config_pck(self):
config_pck_path = os.path.join(self.app_dir, 'config.pck')
if os.path.exists(config_pck_path):
with open(config_pck_path) as fd:
with open(config_pck_path, 'rb') as fd:
config = pickle.load(fd)
else:
config = {}
yield config
with open(config_pck_path, 'w') as fd:
with open(config_pck_path, 'wb') as fd:
pickle.dump(config, fd)
def add_api_secret(self, orig, secret):