mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#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:
parent
af51c2f7bb
commit
8c7e288129
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
|||||||
Release 0.6.7 (in development)
|
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)
|
Release 0.6.6 (May 25, 2010)
|
||||||
============================
|
============================
|
||||||
|
@ -118,7 +118,7 @@ class LiteralInclude(Directive):
|
|||||||
codec_info = codecs.lookup(encoding)
|
codec_info = codecs.lookup(encoding)
|
||||||
try:
|
try:
|
||||||
f = codecs.StreamReaderWriter(open(fn, 'U'),
|
f = codecs.StreamReaderWriter(open(fn, 'U'),
|
||||||
codec_info.streamreader, codec_info.streamwriter, 'strict')
|
codec_info[2], codec_info[3], 'strict')
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
f.close()
|
f.close()
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
|
Loading…
Reference in New Issue
Block a user