Skip to content

Commit c8116ad

Browse files
committed
fix: failing unitest with Py3.5 initialization reading script_files
1 parent 02cfcc9 commit c8116ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/mysqld.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,12 @@ def bootstrap(self):
571571
for filename in script_files:
572572
full_path = os.path.join(self._scriptdir, filename)
573573
LOGGER.debug("Reading SQL from '%s'", full_path)
574-
with open(full_path, 'r') as fp:
575-
sql.extend([line.strip() for line in fp.readlines()])
574+
if sys.version_info[0] == 2:
575+
with open(full_path, 'r') as fp:
576+
sql.extend([line.strip() for line in fp.readlines()])
577+
else:
578+
with open(full_path, 'r', encoding="utf-8") as fp:
579+
sql.extend([line.strip() for line in fp.readlines()])
576580

577581
fp_log = open(bootstrap_log, 'w')
578582
if self._version[0:2] < (8, 0) or self._version < (5, 7, 21):

0 commit comments

Comments
 (0)