diff options
Diffstat (limited to 'docutils/parsers/rst')
-rw-r--r-- | docutils/parsers/rst/directives/misc.py | 17 | ||||
-rw-r--r-- | docutils/parsers/rst/directives/tables.py | 8 |
2 files changed, 12 insertions, 13 deletions
diff --git a/docutils/parsers/rst/directives/misc.py b/docutils/parsers/rst/directives/misc.py index 63775bb7c..d34b6266d 100644 --- a/docutils/parsers/rst/directives/misc.py +++ b/docutils/parsers/rst/directives/misc.py @@ -69,10 +69,10 @@ class Include(Directive): try: self.state.document.settings.record_dependencies.add(path) include_file = io.FileInput( - source_path=path, encoding=encoding, - error_handler=(self.state.document.settings.\ - input_encoding_error_handler), - handle_io_errors=None) + source_path=path, + encoding=encoding, + error_handler= + self.state.document.settings.input_encoding_error_handler) except IOError, error: raise self.severe(u'Problems with "%s" directive path:\n%s.' % (self.name, ErrorString(error))) @@ -198,11 +198,10 @@ class Raw(Directive): self.options['file'])) path = utils.relative_path(None, path) try: - raw_file = io.FileInput( - source_path=path, encoding=encoding, - error_handler=(self.state.document.settings.\ - input_encoding_error_handler), - handle_io_errors=None) + eh = self.state.document.settings.input_encoding_error_handler + raw_file = io.FileInput(source_path=path, + encoding=encoding, + error_handler=eh) # TODO: currently, raw input files are recorded as # dependencies even if not used for the chosen output format. self.state.document.settings.record_dependencies.add(path) diff --git a/docutils/parsers/rst/directives/tables.py b/docutils/parsers/rst/directives/tables.py index fcf3c2b83..25b5f50d8 100644 --- a/docutils/parsers/rst/directives/tables.py +++ b/docutils/parsers/rst/directives/tables.py @@ -271,10 +271,10 @@ class CSVTable(Table): try: self.state.document.settings.record_dependencies.add(source) csv_file = io.FileInput( - source_path=source, encoding=encoding, - error_handler=(self.state.document.settings.\ - input_encoding_error_handler), - handle_io_errors=None) + source_path=source, + encoding=encoding, + error_handler= + self.state.document.settings.input_encoding_error_handler) csv_data = csv_file.read().splitlines() except IOError, error: severe = self.state_machine.reporter.severe( |