Re: [Django] #29830: EmailMessage does not respect body encoding

2018-10-06 Thread Django
#29830: EmailMessage does not respect body encoding
-+-
 Reporter:  jannschu |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Uncategorized|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  email, mail, | Triage Stage:
  encoding   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by jannschu:

Old description:

> I want to change the body encoding (base64, quoted-printible) of an
> email. Example code:
>
> {{{
> #!python
> from email import charset
> from django.core.mail import EmailMessage
>
> msg = EmailMessage("Subject", "Hello World")
> encoding = charset.Charset("utf--8")
> encoding.body_encoding = charset.QP
> msg.encoding = encoding
> print(msg)  # Is not encoded with quoted-printables
> }}}
>
> The quoted-printible encoding in this case is overwritten in
> `SafeMIMEText`. The `encoding` property of `EmailMessage` seems not to be
> documented? I attached a patch which changes the bahvior of SafeMIMEText
> for the case a `email.charset.Charset` object was given.
>
> Another idea is to add a new property to `EmailMessage.__init__` which
> allows to set the body encoding.
>
> Versions 1.11 through master are affected.

New description:

 I want to change the body encoding (base64, quoted-printible) of an email.
 Example code:

 {{{
 #!python
 from email import charset
 from django.core.mail import EmailMessage

 msg = EmailMessage("Subject", "Hello World")
 encoding = charset.Charset("utf-8")
 encoding.body_encoding = charset.QP
 msg.encoding = encoding
 print(msg)  # Is not encoded with quoted-printables
 }}}

 The quoted-printible encoding in this case is overwritten in
 `SafeMIMEText`. The `encoding` property of `EmailMessage` seems not to be
 documented? I attached a patch which changes the bahvior of SafeMIMEText
 for the case a `email.charset.Charset` object was given.

 Another idea is to add a new property to `EmailMessage.__init__` which
 allows to set the body encoding.

 Versions 1.11 through master are affected.

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.2e85af69226a87bb5783c146cbce9103%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29830: EmailMessage does not respect body encoding

2018-10-06 Thread Django
#29830: EmailMessage does not respect body encoding
-+-
 Reporter:  jannschu |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Uncategorized|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  email, mail, | Triage Stage:
  encoding   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by jannschu):

 * Attachment "patch.diff" added.


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e66bfbc867c74565c27ee8c85ee3a7af%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #29830: EmailMessage does not respect body encoding

2018-10-06 Thread Django
#29830: EmailMessage does not respect body encoding
-+-
   Reporter:  jannschu   |  Owner:  nobody
   Type:  New| Status:  new
  feature|
  Component: |Version:  master
  Uncategorized  |   Keywords:  email, mail,
   Severity:  Normal |  encoding
   Triage Stage: |  Has patch:  1
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I want to change the body encoding (base64, quoted-printible) of an email.
 Example code:

 {{{
 #!python
 from email import charset
 from django.core.mail import EmailMessage

 msg = EmailMessage("Subject", "Hello World")
 encoding = charset.Charset("utf--8")
 encoding.body_encoding = charset.QP
 msg.encoding = encoding
 print(msg)  # Is not encoded with quoted-printables
 }}}

 The quoted-printible encoding in this case is overwritten in
 `SafeMIMEText`. The `encoding` property of `EmailMessage` seems not to be
 documented? I attached a patch which changes the bahvior of SafeMIMEText
 for the case a `email.charset.Charset` object was given.

 Another idea is to add a new property to `EmailMessage.__init__` which
 allows to set the body encoding.

 Versions 1.11 through master are affected.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.fb026941a5cece19b646ffe671f46b8f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.