Ticket #3663 defect closed fixed
imap4-utf-7 codec improperly registered
| Reported by: | exarkun | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Keywords: | easy | |
| Cc: | Branch: | branches/imap4-utf7-registration-3663 | |
| Author: | exarkun | Launchpad Bug: |
Description
In Python 2.5, it's not possible to look up the imap4-utf-7 codec registered by twisted/mail/imap4.py:
exarkun@boson:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from twisted.mail import imap4
>>> import codecs
>>> codecs.lookup('imap4-utf-7')
(<function encoder at 0x8395df4>, <function decoder at 0x8395e2c>, <class twisted.mail.imap4.StreamReader at 0x837bdac>, <class twisted.mail.imap4.StreamWriter at 0x837bddc>)
>>> codecs.getreader('imap4-utf-7')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/codecs.py", line 920, in getreader
return lookup(encoding).streamreader
AttributeError: 'tuple' object has no attribute 'streamreader'
>>>
Though this did use to work:
exarkun@boson:~$ ~/Projects/python/branches/release23-maint/python
Python 2.3.7 (#2, Mar 25 2008, 19:31:49)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from twisted.mail import imap4
>>> import codecs
>>> codecs.getreader('imap4-utf-7')
<class twisted.mail.imap4.StreamReader at 0xb7a0d5fc>
>>>
Also, StreamWriter might be misdefined. It has a decode method, but perhaps it should have an encode method.
Change History
Note: See
TracTickets for help on using
tickets.
