Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening in U mode has been deprecated and removed in Python 3.9. #50

Merged
merged 2 commits into from
May 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tendo/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ def setUp(self):

def test_read_utf8(self):
try:
f = open(os.path.join(self.dir, "tests/utf8.txt"), "rU")
if six.PY2:
mode = "rU"
else:
mode = "r"
f = open(os.path.join(self.dir, "tests/utf8.txt"), mode)
f.readlines()
f.close()
except Exception:
Expand All @@ -104,7 +108,11 @@ def test_read_utf8(self):
def test_read_invalid_utf8(self):
passed = False
try:
f = open(os.path.join(self.dir, "tests/utf8-invalid.txt"), "rU")
if six.PY2:
mode = "rU"
else:
mode = "r"
f = open(os.path.join(self.dir, "tests/utf8-invalid.txt"), mode)
f.readlines()
f.close()
except Exception:
Expand Down