From c8c1b560e87ca567e52e11ef0724e14d864a03a5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-DPA61F8\\Benedek" Date: Sun, 18 Apr 2021 22:53:38 +0200 Subject: [PATCH] os.path.sep --- server/authentication.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/authentication.py b/server/authentication.py index b3612c3..3610e9c 100644 --- a/server/authentication.py +++ b/server/authentication.py @@ -83,7 +83,7 @@ class Authetication: ##Save private key in separate file user_privatekey = {'passphrase': user_passphrase, 'privateClientKey': private_key_value, 'publicServerKey': public_server_key} - with open(self.PRIVATE_KEY_DIRECTORY_LOCATION + '\\' + str(data['index']) + '.txt', 'w+') as outfile: + with open(self.PRIVATE_KEY_DIRECTORY_LOCATION + os.path.sep + str(data['index']) + '.txt', 'w+') as outfile: json.dump(user_privatekey, outfile) ##Save public key in users @@ -110,7 +110,7 @@ class Authetication: auth_logger.debug("User NOT saved! This username already exists!") return False else: - if not os.path.isdir(self.HOME_DIRECTORY_LOCATION + "\\" + str(data['index'] + 1)): + if not os.path.isdir(self.HOME_DIRECTORY_LOCATION + os.path.sep + str(data['index'] + 1)): data['index'] = data['index'] + 1 user = { 'username': username, @@ -120,7 +120,7 @@ class Authetication: } ##Create user HOME directory with index as name - os.mkdir(self.HOME_DIRECTORY_LOCATION + '\\' + str(data['index'])) + os.mkdir(self.HOME_DIRECTORY_LOCATION + os.path.sep + str(data['index'])) ##Save user data data['user'].append(user)