[issue1525919] email package content-transfer-encoding behaviour changed

2021-12-13 Thread Thomas Arendsen Hein

Thomas Arendsen Hein  added the comment:

Default python3 on Debian buster:
$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.mime.text
>>> mt = email.mime.text.MIMEText('Ta mère', 'plain', 'utf-8')
>>> print(mt.as_string())
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64

VGEgbcOocmU=

>>> email.encoders.encode_quopri(mt)
>>> print(mt.as_string())
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Transfer-Encoding: quoted-printable

Ta=20m=C3=A8re

So the encoded text looks good now, but there are still duplicate headers.

Old output (python2.7) is identical to what Asheesh Laroia (paulproteus)
reported for python2.5:
---
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Transfer-Encoding: quoted-printable

VGEgbcOocmU=3D
---

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue1525919>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16202] sys.path[0] security issues

2018-02-07 Thread Thomas Arendsen Hein

Thomas Arendsen Hein <tho...@intevation.de> added the comment:

I just stumbled across this problem when starting "idle3" in a directory 
containing a copy of textwrap.py which was not compatible with python3.

In issue13506 idle3 was changed to behave like the regular python shell, i.e. 
as described here in this issue, and since my ~/.pythonrc.py imports readline, 
I could reproduce this problem by creating a bogus readline.py file and 
starting a python interpreter.

So besides being a security issue when starting python or idle in untrusted 
directories, it may cause technical issues when working in directories 
containing .py files with certain names.

--
nosy: +ThomasAH

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue16202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1525919] email package quoted printable behaviour changed

2010-05-05 Thread Thomas Arendsen Hein

Thomas Arendsen Hein tho...@intevation.de added the comment:

Roger Demetrescu, I filed the issue with Python 2.4, because the behavior 
changed somewhere between 2.4.2 and 2.4.3

The updated link to the MoinMoin bug entry is:
http://moinmo.in/MoinMoinBugs/ResetPasswordEmailImproperlyEncoded

The workaround I use to be compatible with = 2.4.2 and = 2.4.3 is:

msg.set_payload('=')
if msg.as_string().endswith('='):
text = charset.body_encode(text)
msg.set_payload(text)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1525919
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com