diff --git a/CHANGES b/CHANGES index 15239fd09..54f4d9278 100644 --- a/CHANGES +++ b/CHANGES @@ -103,6 +103,9 @@ New features added Release 0.5.2 (in development) ============================== +* Open literalinclude files in universal newline mode to allow + arbitrary newline conventions. + * Actually make the ``-Q`` option work. * #86: Fix explicit document titles in toctrees. diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 74ac8e7f0..d738a2794 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -75,7 +75,7 @@ def literalinclude_directive(name, arguments, options, content, lineno, encoding = options.get('encoding', env.config.source_encoding) try: - f = codecs.open(fn, 'r', encoding) + f = codecs.open(fn, 'rU', encoding) lines = f.readlines() f.close() except (IOError, OSError):