Commits

Georg Brandl committed b1cebf5

Open literalinclude files in universal newline mode to allow
arbitrary newline conventions.

Comments (0)

Files changed (2)

 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.

sphinx/directives/code.py

 
     encoding = options.get('encoding', env.config.source_encoding)
     try:
-        f = codecs.open(fn, 'r', encoding)
+        f = codecs.open(fn, 'rU', encoding)
         text = f.read()
         f.close()
     except (IOError, OSError):