This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unnecessary arguments on smtpd.SMTPServer
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: barry, eric.smith, r.david.murray, sleepycal
Priority: normal Keywords:

Created on 2016-01-07 12:16 by sleepycal, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg257684 - (view) Author: Cal Leeming (sleepycal) Date: 2016-01-07 12:16
`smtpd.SMTPServer` takes argument `remoteaddr`, however this is only used in subclass `smtpd.DebuggingServer`.

Would anyone object to a patch which removes `remoteaddr` from `smtpd.SMTPServer.__init__` and places it into `smtpd.DebuggingServer.__init__` instead?

Naturally this would be backwards incompatible
msg257692 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2016-01-07 14:29
We won't make such a backward-incompatible change. Because subclassing is how you extend SMTPServer, it's likely to be used by other derived classes, not in the standard library.

I could see some argument for making it optional and default to None, but that's about the extent of what I would support.

PS: It's used in PureProxy, not DebuggingServer (at least in 3.6, where I checked).
msg257693 - (view) Author: Cal Leeming (sleepycal) Date: 2016-01-07 14:47
Apologies for the typo, it is indeed `PureProxy`. Setting a default of `None` sounds like a good plan, since it won't break backwards compatibility.
msg258109 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2016-01-12 16:44
Tangentially, I'm kind of hoping we can get this into 3.6 as an asyncio replacement for smtpd: https://gitlab.com/python-smtpd-hackers/aiosmtpd
msg258110 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2016-01-12 17:07
I'd forgotten that issue 25008 is about deprecating SMTPServer (or not, there are multiple opinions on it).
msg309746 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-01-10 00:50
I'm closing this as won't fix simce smtpd.py is deprecated and likely won't see any future improvements.  Please take a look at aiosmtpd as a much better third party replacement.
History
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70224
2018-01-10 00:50:19barrysetstatus: open -> closed
resolution: wont fix
messages: + msg309746

stage: resolved
2016-01-18 20:17:40r.david.murraysetnosy: + r.david.murray
2016-01-12 17:07:40eric.smithsetmessages: + msg258110
2016-01-12 16:44:04barrysetmessages: + msg258109
2016-01-08 18:40:30terry.reedysetversions: + Python 3.6
2016-01-07 19:54:34barrysetnosy: + barry
2016-01-07 14:47:43sleepycalsetmessages: + msg257693
2016-01-07 14:29:28eric.smithsetnosy: + eric.smith
messages: + msg257692
2016-01-07 12:16:23sleepycalcreate