#440: Remove usage of a Python >= 2.5 API in the `literalinclude` directive.

CodecInfo is not a namedtuple, so accessing attributes on 2.4 fails.
This commit is contained in:
Georg Brandl 2010-06-05 18:27:43 +02:00
parent af51c2f7bb
commit 8c7e288129
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
Release 0.6.7 (in development)
==============================
* #440: Remove usage of a Python >= 2.5 API in the ``literalinclude``
directive.
Release 0.6.6 (May 25, 2010)
============================

View File

@ -118,7 +118,7 @@ class LiteralInclude(Directive):
codec_info = codecs.lookup(encoding)
try:
f = codecs.StreamReaderWriter(open(fn, 'U'),
codec_info.streamreader, codec_info.streamwriter, 'strict')
codec_info[2], codec_info[3], 'strict')
lines = f.readlines()
f.close()
except (IOError, OSError):