Handle all path- and file-names as bytestings

This commit is contained in:
Jens Luetjen 2016-04-01 19:39:48 +02:00
parent cf5dfccee2
commit e9db19a352
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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
"""