Skip to content

Commit

Permalink
Merge pull request #4 from antonandreyev/patch-1
Browse files Browse the repository at this point in the history
Forced UTF-8 encoding on reading
  • Loading branch information
coolbho3k authored Dec 6, 2016
2 parents fb5c163 + 2c26b19 commit fb6cf9b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions manuf/manuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import argparse
import re
import sys
import io

try:
from urllib2 import urlopen
Expand All @@ -31,12 +32,9 @@
from urllib.error import URLError

try:
from cStringIO import StringIO
from StringIO import StringIO
except ImportError:
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from io import StringIO

# Vendor tuple
Vendor = namedtuple('Vendor', ['manuf', 'comment'])
Expand Down Expand Up @@ -81,7 +79,7 @@ def refresh(self, manuf_name=None):
"""
if not manuf_name:
manuf_name = self._manuf_name
with open(manuf_name, "r") as read_file:
with io.open(manuf_name, "r", encoding="utf-8") as read_file:
manuf_file = StringIO(read_file.read())
self._masks = {}

Expand Down

0 comments on commit fb6cf9b

Please sign in to comment.