From 1c143605a92dff49c3dbf58e6d14097cd72db68a Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 20 Feb 2018 12:13:26 -0800 Subject: [PATCH] Remove deprecated U option to open on python 3. [Issue #252] --- dns/zone.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dns/zone.py b/dns/zone.py index 37f23d3d..6606bef0 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -1021,7 +1021,10 @@ def from_file(f, origin=None, rdclass=dns.rdataclass.IN, """ str_type = string_types - opts = 'rU' + if PY3: + opts = 'rU' + else: + opts = 'r' if isinstance(f, str_type): if filename is None: -- 2.47.3