Handle all path- and file-names as bytestings
This commit is contained in:
parent
cf5dfccee2
commit
e9db19a352
@ -174,7 +174,7 @@ class Core(
|
||||
Save current state to disk.
|
||||
"""
|
||||
|
||||
file_name = os.path.join(self._get_data_dir(), b'state.json.gz')
|
||||
file_name = bytes(os.path.join(self._get_data_dir(), b'state.json.gz'))
|
||||
logger.info('Save state to %s', file_name)
|
||||
|
||||
data = {}
|
||||
@ -206,7 +206,7 @@ class Core(
|
||||
:type coverage: list of string (see above)
|
||||
"""
|
||||
|
||||
file_name = os.path.join(self._get_data_dir(), b'state.json.gz')
|
||||
file_name = bytes(os.path.join(self._get_data_dir(), b'state.json.gz'))
|
||||
logger.info('Load state from %s', file_name)
|
||||
|
||||
data = storage.load(file_name)
|
||||
|
||||
@ -17,7 +17,7 @@ def load(path):
|
||||
Deserialize data from file.
|
||||
|
||||
:param path: full path to import file
|
||||
:type path: str
|
||||
:type path: bytes
|
||||
:return: deserialized data
|
||||
:rtype: dict
|
||||
"""
|
||||
@ -40,7 +40,7 @@ def dump(path, data):
|
||||
Serialize data to file.
|
||||
|
||||
:param path: full path to export file
|
||||
:type path: str
|
||||
:type path: bytes
|
||||
:param data: dictionary containing data to save
|
||||
:type data: dict
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user