Title: Replace asyncore
Type: Stage: needs patch
Components: asyncio Versions: Python 3.7
Status: open Resolution:
Dependencies: 30514 Superseder:
Assigned To: Nosy List: Mariatta, aeros, dankreso, grzgrzgrz3, jacksonriley, nanjekyejoannah, vstinner, yselivanov
Priority: normal Keywords:

Created on 2016-10-25 18:32 by Mariatta, last changed 2019-11-20 17:28 by jacksonriley.

Messages (11)
msg279439 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-10-25 18:32
Deprecation warning was added to asyncore in

asyncore is still used in several tests and should be replaced.
msg291907 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-19 21:40
> asyncore is still used in several tests and should be replaced.

Here is the list of Python files using asyncore:

haypo@selma$ grep -l asyncore $(find -name "*.py")

smtpd has been rewritten with asyncio:

The documentation of the smtpd module already points to aiosmtpd.

libregrtest/ only checks that asyncore.socket_map is not modified, we can keep it until asyncore is really removed. only tests that it's possible to have a "clean" import of asyncore, it can be easily be replaced later.

The list can reduced to:

msg291908 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-19 21:41
asyncore was modified to emit a DeprecationWarning:

But then a lot of code starts with to fail -Werror.

Copy of Martin Panter's msg279469:

I normally run the tests with -Werror, and the failures I get are:

* test_ssl, test_smtplib, test_poplib, test_logging, test_ftplib, test_support: tests use asyncore
* test_os: test uses asynchat (When you import asynchat, the first error complains about importing asyncore, there are actually two warnings)
* test_all: This seems to ignore DeprecationWarning; perhaps an exception for PendingDeprecationWarning should also be added?
* test_asyncore and test_asynchat: Obviously these have to still test the modules, so they should anticipate the warnings, perhaps using Serhiy’s code
* test_smtpd: smtpd module itself uses asyncore; see Issue 25008
msg294710 - (view) Author: Grzegorz Grzywacz (grzgrzgrz3) * Date: 2017-05-29 19:46
I would like to work on this issue.

I think it's a good idea to split this task into few parts/PR.

Let me start from ./Lib/test/

What about rewriting pop3 server stub using asyncio, i think requests could be handled synchronously, there will be no benefits from asynchronous.

Please let me know what you think.
msg294712 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-29 20:34
> I think it's a good idea to split this task into few parts/PR. Let me start from ./Lib/test/

Once you have a patch, open a new issue and mention it here.
msg294771 - (view) Author: Grzegorz Grzywacz (grzgrzgrz3) * Date: 2017-05-30 17:25
sub-issue issue28533
msg294773 - (view) Author: Grzegorz Grzywacz (grzgrzgrz3) * Date: 2017-05-30 17:29
sub-issue issue30514

Fixed issue number from previous comment
msg356355 - (view) Author: (dankreso) * Date: 2019-11-11 09:27
Hi, is this still open?

I'm happy to work on replacing asyncore usage in one of the other test files.
msg356364 - (view) Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) Date: 2019-11-11 14:38
@dankreso, the issue is still open and no one has claimed it yet. So feel free to open a pull request.
msg356369 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2019-11-11 16:54
> I'm happy to work on replacing asyncore usage in one of the other test files.

Sounds good, just let us know which one(s) you're working on. (:
msg357088 - (view) Author: Jackson Riley (jacksonriley) * Date: 2019-11-20 17:28
Lib/test/ - subissue issue38866
A trivial one!
Date User Action Args
2019-11-20 17:28:56jacksonrileysetnosy: + jacksonriley
messages: + msg357088
2019-11-11 16:54:14aerossetmessages: + msg356369
2019-11-11 14:38:11nanjekyejoannahsetmessages: + msg356364
2019-11-11 09:27:48dankresosetnosy: + dankreso
messages: + msg356355
2019-10-14 23:43:37aerossetnosy: + aeros
2019-04-25 18:06:52nanjekyejoannahsetnosy: + nanjekyejoannah
2017-05-30 17:35:04gvanrossumsetnosy: - gvanrossum
2017-05-30 17:32:46Mariattasetdependencies: + test_poplib replace asyncore
2017-05-30 17:29:20grzgrzgrz3setmessages: + msg294773
2017-05-30 17:25:17grzgrzgrz3setmessages: + msg294771
2017-05-29 20:45:09Mariattasetstage: needs patch
versions: + Python 3.7
2017-05-29 20:34:16vstinnersetmessages: + msg294712
2017-05-29 19:46:56grzgrzgrz3setnosy: + grzgrzgrz3
messages: + msg294710
2017-04-19 21:41:40vstinnersetmessages: + msg291908
2017-04-19 21:40:01vstinnersetnosy: + vstinner
messages: + msg291907
2016-10-25 18:33:12Mariattasetnosy: + gvanrossum, yselivanov
components: + asyncio
2016-10-25 18:32:04Mariattacreate