test/wcs: read/write files in binary mode when pickling (#38781)
This commit is contained in:
parent
85676130c2
commit
723b1e532a
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue