Skip to content

Commit

Permalink
Try to fix python 2.7 support for #62
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Nov 18, 2019
1 parent 63e5457 commit 281fcdb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion skosify/rdftools/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def read_rdf(sources, infmt):
if source == '-':
f = sys.stdin
else:
f = open(source, 'r', encoding='utf-8-sig')
if sys.version_info[0] >= 3:
# Python 3+ - force UTF-8
f = open(source, 'r', encoding='utf-8-sig')
else:
f = open(source, 'r')

if infmt:
fmt = infmt
Expand Down

0 comments on commit 281fcdb

Please sign in to comment.