Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Commitffe9ba0
* Fix for email.generator.Generator with whitespace between encoded words.email.generator.Generator currently does not handle whitespace betweenencoded words correctly when the encoded words span multiple lines. Thecurrent generator will create an encoded word for each line. If the endof the line happens to correspond with the end real word in theplaintext, the generator will place an unencoded space at the start ofthe subsequent lines to represent the whitespace between the plaintextwords.A compliant decoder will strip all the whitespace from between twoencoded words which leads to missing spaces in the round-trippedoutput.The fix for this is to make sure that whitespace between two encodedwords ends up inside of one or the other of the encoded words. Thisfix places the space inside of the second encoded word.A second problem happens with continuation lines. A continuation line thatstarts with whitespace and is followed by a non-encoded word is fine becausethe newline between such continuation lines is defined as condensing toa single space character. When the continuation line starts with whitespacefollowed by an encoded word, however, the RFCs specify that the word is runtogether with the encoded word on the previous line. This is because normalwords are filded on syntactic breaks by encoded words are not.The solution to this is to add the whitespace to the start of the encoded wordon the continuation line.Test cases are fromGH-92081* Rename a variable so it's not confused with the final variable.(cherry picked from commita6fdb31)Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
1 parent386e492 commitffe9ba0
File tree
4 files changed
+79
-8
lines changed- Lib
- email
- test/test_email
- Misc/NEWS.d/next/Library
4 files changed
+79
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2784 | 2784 | | |
2785 | 2785 | | |
2786 | 2786 | | |
2787 | | - | |
2788 | | - | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
2789 | 2793 | | |
2790 | 2794 | | |
2791 | | - | |
| 2795 | + | |
2792 | 2796 | | |
2793 | 2797 | | |
2794 | 2798 | | |
| |||
2812 | 2816 | | |
2813 | 2817 | | |
2814 | 2818 | | |
| 2819 | + | |
2815 | 2820 | | |
2816 | 2821 | | |
2817 | 2822 | | |
2818 | 2823 | | |
| 2824 | + | |
2819 | 2825 | | |
2820 | 2826 | | |
2821 | 2827 | | |
| |||
2847 | 2853 | | |
2848 | 2854 | | |
2849 | 2855 | | |
2850 | | - | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
2851 | 2860 | | |
2852 | 2861 | | |
2853 | 2862 | | |
| 2863 | + | |
2854 | 2864 | | |
2855 | 2865 | | |
2856 | 2866 | | |
| 2867 | + | |
2857 | 2868 | | |
2858 | 2869 | | |
2859 | 2870 | | |
| 2871 | + | |
2860 | 2872 | | |
2861 | 2873 | | |
2862 | 2874 | | |
2863 | 2875 | | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
2864 | 2880 | | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
2865 | 2888 | | |
2866 | 2889 | | |
2867 | 2890 | | |
| |||
2885 | 2908 | | |
2886 | 2909 | | |
2887 | 2910 | | |
| 2911 | + | |
2888 | 2912 | | |
2889 | 2913 | | |
2890 | | - | |
| 2914 | + | |
2891 | 2915 | | |
2892 | 2916 | | |
2893 | 2917 | | |
| |||
2902 | 2926 | | |
2903 | 2927 | | |
2904 | 2928 | | |
2905 | | - | |
| 2929 | + | |
2906 | 2930 | | |
2907 | 2931 | | |
2908 | 2932 | | |
2909 | 2933 | | |
2910 | 2934 | | |
2911 | 2935 | | |
2912 | 2936 | | |
| 2937 | + | |
2913 | 2938 | | |
2914 | 2939 | | |
2915 | 2940 | | |
| |||
2929 | 2954 | | |
2930 | 2955 | | |
2931 | 2956 | | |
2932 | | - | |
| 2957 | + | |
2933 | 2958 | | |
2934 | 2959 | | |
2935 | 2960 | | |
2936 | 2961 | | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
2937 | 2971 | | |
2938 | 2972 | | |
2939 | 2973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
284 | 319 | | |
285 | 320 | | |
286 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
1648 | 1649 | | |
1649 | 1650 | | |
1650 | 1651 | | |
1651 | | - | |
| 1652 | + | |
1652 | 1653 | | |
1653 | 1654 | | |
1654 | 1655 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments
Comments
(0)