python / cpython

The Python programming language
https://www.python.org
Other
63.59k stars 30.46k forks source link

html rendering issue in MIMEText html rendering #125867

Open azmee-meta opened 1 month ago

azmee-meta commented 1 month ago

Bug report

Bug description:

# **DESCRIPTION & CODE**
when there is lots of 

`<tr><td>36</td>  <td>16</td>  <td>-56%</td>  <td></td>  <td></td>  <td></td>  <td></td>  <td></td>  <td></td>  <td></td>  <td></td>  </tr>   <tr> <td></td></tr>` (i make this code dynamically, which sometimes lead to very big table/code, in that case the issue arise)

like this, then sometimes in <td> or <tr> tag render like this(< td> < tr>, put space unexpectedly) and the table breaks in the email body.

**Note:** i am using a little inline css in table, `<html lang='en'><head><meta charset='UTF-8'></head><body><table border=1 bordercolor='black' cellspacing=0 cellpadding=5> <tr>`

msg.attach(MIMEText(html, 'html'))

CPython versions tested on:

3.12

Operating systems tested on:

Windows

RanKKI commented 5 days ago

Hi, can you please Include a minimal, reproducible example ?