Gmail eats Python

Jussi Piitulainen jpiitula at ling.helsinki.fi
Sun Jul 26 07:01:09 CEST 2015


Marko Rauhamaa writes:

> Jussi Piitulainen writes:

>> Just in case anyone cares, Gnus shows me those indentations as octal
>> codes, \302\240\302\240 (followed by one ASCII space). I guess a
>> \302\240 is a NO-BREAK SPACE in UTF-8, and I guess Gnus does not know
>> this because there is no charset specification in the headers. That
>> seems to be missing whenever I see these codes instead of properly
>> rendered characters and bother to check the headers.

> The gnus command
>
>    C-u g
>
> displays the raw message.

Thanks! I was just typing t to see what I thought were the full headers.

> It demonstrates that the posting was sent as
>
>    Content-Type: multipart/alternative; boundary=001a1134d474c99321051bb5ef45
>
> The first part has:
>
>    Content-Type: text/plain; charset=UTF-8
>
> The second part has:
>
>    Content-Type: text/html; charset=UTF-8
>    Content-Transfer-Encoding: quoted-printable

Yes, with C-u g, I see them.

> The text/plain variant expresses the indentations with plain
> whitespace (SPC) characters. However, the text/html variant has:
>
>    <p dir=3D"ltr">=C2=A0=C2=A0 >>> def test(): pass<br>
>    =C2=A0=C2=A0 ... <br>
>    =C2=A0=C2=A0 >>> print('Hi world')<br>
>    =C2=A0=C2=A0 Hi world<br>
>    =C2=A0=C2=A0 >>></p>
>
> =C2=A0 stands for '\u00a0' (NO-BREAK SPACE).

I suppose that's a valid HTML fragment when the charset is declared, but
the Gnus version I use fails to use the charset information when it
renders the message. Annoying that it chooses text/html over text/plain
and then fails. (Probably I can customize it now that I have a precise
idea of what it is that is going wrong.)

> When I have Gnus display the HTML variant, the indentation is not
> displayed at all. I don't know why.

So many ways to fail :)


More information about the Python-list mailing list