Skip to content

Commit

Permalink
Use io module to encode driver log as UTF-8 (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
MuckT authored and davehunt committed Jan 11, 2018
1 parent 602bdbf commit 1ca3aa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pytest_selenium/pytest_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import copy
from datetime import datetime
import os
import io

import pytest
from requests.structures import CaseInsensitiveDict
Expand Down Expand Up @@ -243,7 +244,7 @@ def _gather_logs(item, report, driver, summary, extra):
pytest_html = item.config.pluginmanager.getplugin('html')
if item.config._driver_log and os.path.exists(item.config._driver_log):
if pytest_html is not None:
with open(item.config._driver_log, 'r') as f:
with io.open(item.config._driver_log, 'r', encoding='utf8') as f:
extra.append(pytest_html.extras.text(f.read(), 'Driver Log'))
summary.append('Driver log: {0}'.format(item.config._driver_log))
try:
Expand Down

0 comments on commit 1ca3aa1

Please sign in to comment.