diff options
author | Marc-André Lemburg <mal@egenix.com> | 2006-02-19 15:22:22 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2006-02-19 15:22:22 (GMT) |
commit | fe4b34cc4b3d4c91497460d64c8ed1fe7a983689 (patch) | |
tree | 8fd4ca881b132668b1098cecb6ca710a962c30cc /Lib/test/test_charmapcodec.py | |
parent | c3e950cbf3ff3b44999356a046ab5b10a5bc7612 (diff) | |
download | cpython-fe4b34cc4b3d4c91497460d64c8ed1fe7a983689.zip cpython-fe4b34cc4b3d4c91497460d64c8ed1fe7a983689.tar.gz cpython-fe4b34cc4b3d4c91497460d64c8ed1fe7a983689.tar.bz2 |
Fix the encodings package codec search function to only search
inside its own package. Fixes problem reported in patch #1433198.
Add codec search function for codec test codec.
Diffstat (limited to 'Lib/test/test_charmapcodec.py')
-rw-r--r-- | Lib/test/test_charmapcodec.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Lib/test/test_charmapcodec.py b/Lib/test/test_charmapcodec.py index 79d82c1..2866984 100644 --- a/Lib/test/test_charmapcodec.py +++ b/Lib/test/test_charmapcodec.py @@ -11,8 +11,19 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). import test.test_support, unittest -# test codec's full path name (see test/testcodec.py) -codecname = 'test.testcodec' +import codecs + +# Register a search function which knows about our codec +def codec_search_function(encoding): + if encoding == 'testcodec': + from test import testcodec + return tuple(testcodec.getregentry()) + return None + +codecs.register(codec_search_function) + +# test codec's name (see test/testcodec.py) +codecname = 'testcodec' class CharmapCodecTest(unittest.TestCase): def test_constructorx(self): |