Skip to content

Commit 26cf74a

Browse files
committed
Handle utf-8 encoding with the ide export converter tool
1 parent 84fd02a commit 26cf74a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

seleniumbase/utilities/selenium_ide/convert_ide.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
"""
23
Converts a Selenium IDE recording that was exported as a Python WebDriver
34
unittest file into SeleniumBase Python file.
@@ -50,7 +51,7 @@ def main():
5051
uses_keys = False
5152
uses_select = False
5253

53-
f = open(webdriver_python_file, 'r')
54+
f = open(webdriver_python_file, 'r', encoding='utf-8')
5455
all_code = f.read()
5556
f.close()
5657
if "def test_" not in all_code:
@@ -722,7 +723,7 @@ def main():
722723
# Create SeleniumBase test file
723724
base_file_name = webdriver_python_file.split('.py')[0]
724725
converted_file_name = base_file_name + "_SB.py"
725-
out_file = codecs.open(converted_file_name, "w+")
726+
out_file = codecs.open(converted_file_name, "w+", encoding='utf-8')
726727
out_file.writelines(seleniumbase_code)
727728
out_file.close()
728729
print('\n>>> [%s] was created from [%s]\n' % (

0 commit comments

Comments
 (0)