[Python-checkins] r66918 - doctools/trunk/sphinx/directives/code.py

georg.brandl python-checkins at python.org
Thu Oct 16 21:25:31 CEST 2008


Author: georg.brandl
Date: Thu Oct 16 21:25:31 2008
New Revision: 66918

Log:
Let include encoding default to source encoding.


Modified:
   doctools/trunk/sphinx/directives/code.py

Modified: doctools/trunk/sphinx/directives/code.py
==============================================================================
--- doctools/trunk/sphinx/directives/code.py	(original)
+++ doctools/trunk/sphinx/directives/code.py	Thu Oct 16 21:25:31 2008
@@ -68,7 +68,7 @@
         lineno - state_machine.input_offset - 1)))
     fn = path.normpath(path.join(source_dir, rel_fn))
 
-    encoding = options.get('encoding', 'utf-8')
+    encoding = options.get('encoding', env.config.source_encoding)
     try:
         f = codecs.open(fn, 'r', encoding)
         text = f.read()


More information about the Python-checkins mailing list