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.

Author aeros
Recipients aeros, asvetlov, eric.smith, pgjones, yselivanov
Date 2020-04-02.04:17:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585801071.88.0.597878622316.issue40124@roundup.psfhosted.org>
In-reply-to
Content
> Do we really want this to be just an assert, or do we want to raise another type of exception?

IMO, we should look into converting this into an exception. Mistakenly having a task await StreamWriter.drain() at the same time as another is calling StreamWriter.write() does seem like a reasonable programming error that should preferably have an informative error message. Optimally, assertions shouldn't occur from normal programming errors in production.

The tricky part is figuring out how to implement it properly. I'm not 100% certain that we can make any guarantees that when the _drain_waiter future hasn't been cancelled and not set to None that someone is mistakenly doing the above. It could potentially trigger from other errors.

Either way though, I think just adding a message to the assert could end up being misleading if someone else encounters this in production for another reason. Instead, I think we could leave a comment there for now and in the long term figure out how to properly implement the exception or warning. We also need a reliable way to reproduce it, mainly for the purpose of writing a new test to ensure the exception is correctly triggered when someone makes the above programming error.
History
Date User Action Args
2020-04-02 04:17:51aerossetrecipients: + aeros, eric.smith, asvetlov, yselivanov, pgjones
2020-04-02 04:17:51aerossetmessageid: <1585801071.88.0.597878622316.issue40124@roundup.psfhosted.org>
2020-04-02 04:17:51aeroslinkissue40124 messages
2020-04-02 04:17:51aeroscreate