brendonh/pyth — pull request #22 by somakrdas (2014-07-21 19:56:47+00:00)
Title: Fix codecs search function to only match 'symbol'

The current search function matches all encodings, which break other packages that use the `codecs` registry like [`cssutils`](https://bitbucket.org/cthedot/cssutils/src/d572ac8df6bd18cad203dea1bbf58867ff0d0ebe/src/cssutils/_codec2.py#cl-565). According to the [`codecs` documentation](https://docs.python.org/2/library/codecs.html):

> In case a search function cannot find a given encoding, it should return `None`.

This pull request fixes the search function to only match `'symbol'`.

Before:
```
>>> from pyth.plugins.rtf15.reader import Rtf15Reader
>>> import codecs
>>> print codecs.getdecoder('symbol')

>>> print codecs.getdecoder('')

```

After:
```
>>> from pyth.plugins.rtf15.reader import Rtf15Reader
>>> import codecs
>>> print codecs.getdecoder('symbol')

>>> print codecs.getdecoder('')
Traceback (most recent call last):
File "", line 1, in
File "/Users/somakrdas/.envs/work/lib/python2.7/codecs.py", line 946, in getdecoder
return lookup(encoding).decode
LookupError: unknown encoding:
```