classification
Title: asynchat's handle_error inconsistency
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: giampaolo.rodola Nosy List: giampaolo.rodola, intgr, iritkatriel, nirs, vstinner
Priority: normal Keywords: patch

Created on 2008-11-07 12:14 by giampaolo.rodola, last changed 2021-06-15 18:50 by iritkatriel. This issue is now closed.

Files
File name Uploaded Description Edit
asynchat.patch giampaolo.rodola, 2008-11-07 12:14 review
Messages (5)
msg75601 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-11-07 12:14
Suppose you have tow sockets handled by two asynchat.async_chat class
instances and from class1 you want to send some data through class2:

class1(asynchat.async_chat):
    
   ...
   
   def mymethod(self):
       class2_instance.push_with_producer(producer)


Since push_with_producer automatically calls initiate_send() if an error
occurs while class2 reads the first chunk of data from the producer,
class1's handle_error gets called.
If the error occurs when reading the next chunks of data class2's
handle_error will be called instead.
This is an inconsistency that should be fixed so that always class2's
handle_error gets called.

The patch in attachment does that.
msg140534 - (view) Author: Nir Soffer (nirs) * Date: 2011-07-17 19:07
The idea is good, but seems that error handling should be inlined into initiate_send.

Also those 3 special exceptions should be defined once in the module instead of repeating them.
msg225996 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-08-27 15:51
This issue is 6 years old. I don't understand the bug and the patch has no unit test. I suggest to close the issue as out of date. The asynchat module is now deprecated in favor of the new shiny asyncio module.
msg226090 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-08-29 21:55
#6550 and #11267 have been closed as out of date as asynchat and asyncore are effectively deprecated in favour of asyncio so can't this go the same way?
msg395893 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-15 18:50
asynchat has been deprecated for a long time, it's unlikely we will do anything with it now.
History
Date User Action Args
2021-06-15 18:50:50iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg395893

resolution: out of date
stage: test needed -> resolved
2019-05-02 04:14:40josiahcarlsonsetnosy: - josiahcarlson, josiah.carlson
2019-04-26 20:31:01BreamoreBoysetnosy: - BreamoreBoy
2014-08-29 21:55:50BreamoreBoysetnosy: + BreamoreBoy
messages: + msg226090
2014-08-29 20:38:24terry.reedysetversions: + Python 3.4, Python 3.5, - Python 3.1, Python 3.2
2014-08-27 15:51:15vstinnersetnosy: + vstinner
messages: + msg225996
2011-07-17 19:07:12nirssetnosy: + nirs
messages: + msg140534
2010-07-10 11:22:36giampaolo.rodolasetassignee: giampaolo.rodola
2010-07-10 09:37:33BreamoreBoysetstage: test needed
versions: + Python 3.1, Python 3.2, - Python 3.0
2009-03-28 12:14:54intgrsetnosy: + intgr
2008-11-07 12:17:53giampaolo.rodolasetversions: + Python 3.0
2008-11-07 12:14:52giampaolo.rodolacreate