From 88f79d63e8b1e07d70e453936f71af8c506745ea Mon Sep 17 00:00:00 2001 From: Tim Mahrt Date: Tue, 28 Jun 2016 20:23:29 +0200 Subject: [PATCH] BUGFIX: 'U' mode depreciated in open in favor of io.open 'U' is universal line support mode, which is the default mode in io.open --- pysle/isletool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysle/isletool.py b/pysle/isletool.py index 093b2a5..c10a304 100644 --- a/pysle/isletool.py +++ b/pysle/isletool.py @@ -4,6 +4,7 @@ Created on Oct 11, 2012 @author: timmahrt ''' +import io vowelList = ['a', '@', 'e', 'i', 'o', 'u', '^', '&', '>', ] @@ -30,7 +31,8 @@ class LexicalTool(): Builds the isle textfile into a dictionary for fast searching ''' lexDict = {} - wordList = [line.rstrip('\n') for line in open(self.islePath, "rU")] + with io.open(self.islePath, "r") as fd: + wordList = [line.rstrip('\n') for line in fd] for row in wordList: word, pronunciation = row.split(" ", 1)