The current search function matches all encodings, which break other packages that use the codecs registry like cssutils. According to the codecs documentation:
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')
<function symbol_decode at 0x109774140>
>>> print codecs.getdecoder('<some_encoding>')
<function symbol_decode at 0x109774140>
After:
>>> from pyth.plugins.rtf15.reader import Rtf15Reader
>>> import codecs
>>> print codecs.getdecoder('symbol')
<function symbol_decode at 0x1043b3140>
>>> print codecs.getdecoder('<some_encoding>')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/somakrdas/.envs/work/lib/python2.7/codecs.py", line 946, in getdecoder
return lookup(encoding).decode
LookupError: unknown encoding: <some_encoding>
The current search function matches all encodings, which break other packages that use the
codecs
registry likecssutils
. According to thecodecs
documentation:This pull request fixes the search function to only match
'symbol'
.Before:
After: