diff --git a/gramps/gen/plug/_options.py b/gramps/gen/plug/_options.py index fa96b5509..c04810698 100644 --- a/gramps/gen/plug/_options.py +++ b/gramps/gen/plug/_options.py @@ -35,7 +35,6 @@ General option handling, including saving and parsing. from __future__ import print_function import os -import io #------------------------------------------------------------------------- # @@ -199,7 +198,7 @@ class OptionListCollection(object): """ Saves the current OptionListCollection to the associated file. """ - f = io.open(self.filename, "w", encoding='utf-8') + f = open(self.filename,"w") f.write("\n") f.write('\n') diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py index 16d99bf50..08aa49883 100644 --- a/gramps/gen/plug/_pluginreg.py +++ b/gramps/gen/plug/_pluginreg.py @@ -1083,7 +1083,7 @@ class PluginRegister(object): full_filename = os.path.join(dir, filename) if sys.version_info[0] < 3: full_filename = full_filename.encode(glocale.getfilesystemencoding()) - fd = open(full_filename, 'r') + fd = open(full_filename, "r") else: fd = io.open(full_filename, 'r', encoding = 'utf-8') stream = fd.read() diff --git a/gramps/gen/plug/docgen/stylesheet.py b/gramps/gen/plug/docgen/stylesheet.py index 016de3b4b..d4e372dd0 100644 --- a/gramps/gen/plug/docgen/stylesheet.py +++ b/gramps/gen/plug/docgen/stylesheet.py @@ -31,7 +31,6 @@ #------------------------------------------------------------------------- import os from xml.sax.saxutils import escape -import io def escxml(string): """ @@ -149,7 +148,7 @@ class StyleSheetList(object): """ Saves the current StyleSheet definitions to the associated file. """ - xml_file = io.open(self.__file, "w", encoding='utf-8') + xml_file = open(self.__file, "w") xml_file.write("\n") xml_file.write('\n') @@ -212,7 +211,7 @@ class StyleSheetList(object): if os.path.isfile(self.__file): parser = make_parser() parser.setContentHandler(SheetParser(self)) - the_file = io.open(self.__file, encoding='utf-8') + the_file = open(self.__file) parser.parse(the_file) the_file.close() except (IOError, OSError, SAXParseException): diff --git a/gramps/gen/plug/report/_book.py b/gramps/gen/plug/report/_book.py index 7279d137c..bb37ead68 100644 --- a/gramps/gen/plug/report/_book.py +++ b/gramps/gen/plug/report/_book.py @@ -31,8 +31,6 @@ # Standard Python modules # #------------------------------------------------------------------------- -import os -import io from ...const import GRAMPS_LOCALE as glocale _ = glocale.get_translation().gettext @@ -43,6 +41,7 @@ _ = glocale.get_translation().gettext #------------------------------------------------------------------------ import logging log = logging.getLogger(".Book") +import os #------------------------------------------------------------------------- # @@ -319,7 +318,7 @@ class BookList(object): """ Saves the current BookList to the associated file. """ - f = io.open(self.file, "w", encoding='utf-8') + f = open(self.file, "w") f.write("\n") f.write('\n') for name in sorted(self.bookmap): # enable a diff of archived copies @@ -371,7 +370,7 @@ class BookList(object): try: p = make_parser() p.setContentHandler(BookParser(self, self.dbase)) - the_file = io.open(self.file, encoding='utf-8') + the_file = open(self.file) p.parse(the_file) the_file.close() except (IOError, OSError, ValueError, SAXParseException, KeyError, diff --git a/gramps/gen/plug/report/_options.py b/gramps/gen/plug/report/_options.py index 379b89f58..7f13996f0 100644 --- a/gramps/gen/plug/report/_options.py +++ b/gramps/gen/plug/report/_options.py @@ -36,7 +36,6 @@ Report option handling, including saving and parsing. import os import copy from xml.sax.saxutils import escape -import io def escxml(d): return escape(d, { '"' : '"' } ) @@ -476,7 +475,7 @@ class OptionListCollection(_options.OptionListCollection): if os.path.isfile(self.filename): p = make_parser() p.setContentHandler(OptionParser(self)) - the_file = io.open(self.filename, encoding = 'utf-8') + the_file = open(self.filename) p.parse(the_file) the_file.close() except (IOError, OSError, SAXParseException): @@ -966,7 +965,7 @@ class DocOptionListCollection(_options.OptionListCollection): if os.path.isfile(self.filename): p = make_parser() p.setContentHandler(DocOptionParser(self)) - the_file = io.open(self.filename, encoding = 'utf-8') + the_file = open(self.filename) p.parse(the_file) the_file.close() except (IOError, OSError, SAXParseException):