Opened 13 years ago
Closed 12 years ago
#4049 defect closed fixed (fixed)
Error IMAP4Client.fetchSpecific an HTML body part
Reported by: | Ilpo Nyyssönen | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Keywords: | ||
Cc: | Thijs Triemstra | Branch: |
branches/imap-fetch-specific-html-4049
branch-diff, diff-cov, branch-cov, buildbot |
Author: | biny, exarkun |
Description
New test for twisted.mail.test.test_imap.IMAP4ClientFetchTests:
def test_fetchSpecificHTML(self): d = self.client.fetchSpecific('7') self.assertEquals( self.transport.value(), '0001 FETCH 7 BODY[]\r\n') self.client.lineReceived('* 7 FETCH (BODY[] "<html>test</html>")') self.client.lineReceived('0001 OK FETCH completed') self.assertEquals( self._extractDeferredResult(d), {7: [['BODY', [], "<html>test</html>"]]})
[ERROR]: twisted.mail.test.test_imap.IMAP4ClientFetchTests.test_fetchSpecificHTML Traceback (most recent call last): File "/home/biny/packages/repositories/twisted/twisted/mail/imap4.py", line 3419, in _cbFetch mapping = self._parseFetchPairs(values[0]) File "/home/biny/packages/repositories/twisted/twisted/mail/imap4.py", line 3401, in _parseFetchPairs "Not enough arguments", fetchResponseList) twisted.mail.imap4.IllegalServerResponse: ('Not enough arguments', ['BODY', [], '<html>test</html>'])
Attachments (1)
Change History (14)
comment:1 Changed 13 years ago by
Summary: | Error fetchSpecific an HTML body part → Error IMAP4Client.fetchSpecific an HTML body part |
---|
comment:2 Changed 13 years ago by
Cc: | Thijs Triemstra added |
---|---|
Owner: | changed from Jean-Paul Calderone to Ilpo Nyyssönen |
comment:3 follow-up: 4 Changed 13 years ago by
Owner: | changed from Ilpo Nyyssönen to Thijs Triemstra |
---|
There isn't any change here. Only a new failing test.
comment:4 Changed 13 years ago by
Keywords: | review added |
---|---|
Owner: | Thijs Triemstra deleted |
Replying to biny:
There isn't any change here. Only a new failing test.
Right, and that test can be added by supplying a diff.. I'll put the ticket up for review anyway.
comment:5 Changed 13 years ago by
Author: | → therve |
---|---|
Branch: | → branches/image-fetch-specific-html-4049 |
(In [27371]) Branching to 'image-fetch-specific-html-4049'
comment:6 Changed 13 years ago by
Branch: | branches/image-fetch-specific-html-4049 → branches/imap-fetch-specific-html-4049 |
---|
(In [27373]) Branching to 'imap-fetch-specific-html-4049'
comment:8 Changed 13 years ago by
comment:9 Changed 13 years ago by
Author: | therve → biny, exarkun |
---|---|
Keywords: | review added |
r27553 is a terrible hack which partially resolves this issue. I'm also attaching a patch which randomly changes a bunch of things around: this is the result of quite a few hours of trying to fix the parser for real. My conclusion at this point is that there are too many hacks stacked on top of each other in this code. See #4124.
Changed 13 years ago by
Attachment: | imap4-parser-changes.patch added |
---|
Some stuff I did, not being proposed to be committed anyplace, just sayin'
comment:10 Changed 12 years ago by
Owner: | set to Jean-Paul Calderone |
---|
This looks OK to me, except the test has no docstring. Write one, then merge. Also, make it a good one.
comment:11 Changed 12 years ago by
Keywords: | review removed |
---|
comment:12 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [27670]) Merge imap-fetch-specific-html-4049
Author: biny, exarkun Reviewer: glyph Fixes: #4049
Fix a bug in the IMAP4 client parsing code which would misinterpret many html-formatted message bodies as instead being part of the surrounding protocol bits and thus fail to actually make the body content available in the result.
comment:13 Changed 11 years ago by
Owner: | Jean-Paul Calderone deleted |
---|
Thanks, can you provide a unified diff against the twisted trunk? this makes it possible for us to test this change against many platforms using our build farm.