bpo-34246: Use no mutable default args in smtplib by scorphus · Pull Request #8554 · python/cpython

@scorphus

Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected in which it mutates one of the args by
appending items to it, whic has side effects on further calls.

serhiy-storchaka

methane

@scorphus

Just to ensure `smtplib.SMTP.send_message` no longer modifies the
content of the *mail_options* argument

serhiy-storchaka

@scorphus

@scorphus

@scorphus

@scorphus

serhiy-storchaka

vstinner

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Sep 7, 2018
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
(cherry picked from commit d5fbe9b)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

miss-islington added a commit that referenced this pull request

Sep 7, 2018
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
(cherry picked from commit d5fbe9b)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

pablogsal pushed a commit to pablogsal/cpython that referenced this pull request

Sep 8, 2018
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls..
(cherry picked from commit d5fbe9b)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

pablogsal added a commit that referenced this pull request

Sep 8, 2018
)

Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls..
(cherry picked from commit d5fbe9b)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>