@@ -3286,7 +3286,7 @@ def save_cookies(self, name="cookies.txt"):
3286
3286
file_path = abs_path + "/%s" % folder
3287
3287
if not os.path.exists(file_path):
3288
3288
os.makedirs(file_path)
3289
- cookies_file_path = "%s/%s" % (file_path, name)
3289
+ cookies_file_path = os.path.join (file_path, name)
3290
3290
cookies_file = codecs.open(cookies_file_path, "w+", encoding="utf-8")
3291
3291
cookies_file.writelines(json_cookies)
3292
3292
cookies_file.close()
@@ -3305,7 +3305,7 @@ def load_cookies(self, name="cookies.txt"):
3305
3305
folder = constants.SavedCookies.STORAGE_FOLDER
3306
3306
abs_path = os.path.abspath(".")
3307
3307
file_path = abs_path + "/%s" % folder
3308
- cookies_file_path = "%s/%s" % (file_path, name)
3308
+ cookies_file_path = os.path.join (file_path, name)
3309
3309
json_cookies = None
3310
3310
with open(cookies_file_path, "r") as f:
3311
3311
json_cookies = f.read().strip()
@@ -3341,7 +3341,7 @@ def delete_saved_cookies(self, name="cookies.txt"):
3341
3341
folder = constants.SavedCookies.STORAGE_FOLDER
3342
3342
abs_path = os.path.abspath(".")
3343
3343
file_path = abs_path + "/%s" % folder
3344
- cookies_file_path = "%s/%s" % (file_path, name)
3344
+ cookies_file_path = os.path.join (file_path, name)
3345
3345
if os.path.exists(cookies_file_path):
3346
3346
if cookies_file_path.endswith(".txt"):
3347
3347
os.remove(cookies_file_path)
@@ -4213,7 +4213,7 @@ def __process_recorded_actions(self):
4213
4213
file_name = sb_config.behave_scenario.filename.replace(".", "_")
4214
4214
file_name = file_name.split("/")[-1].split("\\")[-1]
4215
4215
file_name = file_name + "_rec.py"
4216
- file_path = "%s/%s" % (recordings_folder, file_name)
4216
+ file_path = os.path.join (recordings_folder, file_name)
4217
4217
out_file = codecs.open(file_path, "w+", "utf-8")
4218
4218
out_file.writelines("\r\n".join(data))
4219
4219
out_file.close()
@@ -5417,7 +5417,7 @@ def save_element_as_image_file(
5417
5417
folder = folder[:-1]
5418
5418
if len(folder) > 0:
5419
5419
self.create_folder(folder)
5420
- image_file_path = "%s/%s" % (folder, file_name)
5420
+ image_file_path = os.path.join (folder, file_name)
5421
5421
if not image_file_path:
5422
5422
image_file_path = file_name
5423
5423
with open(image_file_path, "wb") as file:
@@ -12927,7 +12927,7 @@ def tearDown(self):
12927
12927
12928
12928
s3_bucket = S3LoggingBucket()
12929
12929
guid = str(uuid.uuid4().hex)
12930
- path = "%s/%s" % (self.log_path, test_id)
12930
+ path = os.path.join (self.log_path, test_id)
12931
12931
uploaded_files = []
12932
12932
for logfile in os.listdir(path):
12933
12933
logfile_name = "%s/%s/%s" % (
@@ -12936,7 +12936,7 @@ def tearDown(self):
12936
12936
logfile.split(path)[-1],
12937
12937
)
12938
12938
s3_bucket.upload_file(
12939
- logfile_name, "%s/%s " % (path, logfile)
12939
+ logfile_name, "%s" % os.path.join (path, logfile)
12940
12940
)
12941
12941
uploaded_files.append(logfile_name)
12942
12942
s3_bucket.save_uploaded_file_names(uploaded_files)
0 commit comments