Merge lp:~wgrant/launchpad/emailauthentication.txt-2.6-fix into lp:launchpad
Proposed by
William Grant
Status: | Merged |
---|---|
Approved by: | Michael Nelson |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~wgrant/launchpad/emailauthentication.txt-2.6-fix |
Merge into: | lp:launchpad |
Diff against target: |
25 lines (+5/-4) 1 file modified
lib/canonical/launchpad/doc/emailauthentication.txt (+5/-4) |
To merge this branch: | bzr merge lp:~wgrant/launchpad/emailauthentication.txt-2.6-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | Approve | ||
Review via email: mp+23449@code.launchpad.net |
Commit message
Fix emailauthentica
Description of the change
emailauthentica
Since that fix, msg.as_string() preserves folding correctly, but as_string() on the important part still does not. I've altered the test to check the relevant part, so the test now works on both 2.5 and 2.6. The doctest now also explains the reasonably opaque purpose of the tests.
To post a comment you must log in.
Hi William,
Thanks for sorting this out. Just a suggestion below, see what you think.
> === modified file 'lib/canonical/ launchpad/ doc/emailauthen tication. txt' launchpad/ doc/emailauthen tication. txt 2009-02-19 23:55:18 +0000 launchpad/ doc/emailauthen tication. txt 2010-04-15 01:53:20 +0000 _getSignatureAn dSignedContent. If the second test here
> --- lib/canonical/
> +++ lib/canonical/
> @@ -137,7 +137,10 @@
>
> Python's email library unfolds the headers, which means that we have to
> be careful when extracting the signed content when folded headers are
> -signed.
> +signed. This is done by manually parsing boundaries in
> +SignedMessage.
> +starts failing, Python is probably fixed, so the manual boundary parsing
> +hack can be removed.
Although that makes sense to me at the moment, if I look at that in 6months time when the second test fails, I'll struggle. I was wondering if instead we could say: If the second test here starts failing, [link to remaining python issue if it exists] has probably been fixed and it can be switched back to simply use as_string().
I'll wait to hear from you before sending this off to land.
> message( 'signed_ folded_ header. txt') WHITESPACE "------ ------- ------- EuxKj2iCbKjpUGk D" WHITESPACE payload( i=0).as_ string( ) #doctest: -NORMALIZE_ WHITESPACE "------ ------- ------- EuxKj2iCbKjpUGk D"
> >>> msg = read_test_
> >>> print msg.parsed_string #doctest: -NORMALIZE_
> @@ -147,9 +150,7 @@
> boundary=
> ...
>
> - >>> print msg.as_string() #doctest: -NORMALIZE_
> - Date:...
> - ...
> + >>> print msg.get_
> Content-Type: multipart/mixed; boundary=
> ...