Skip to content

Add audit event for time.sleep #108294

Closed
Closed
@encukou

Description

@encukou

Feature or enhancement

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/27214/8

Proposal:

Add an audit event that async frameworks can use to warn about a common beginner mistake -- using time.sleep instead of await asyncio.sleep.

This is not meant for async experts. There are better tools for diagnosing “freezes” in async code, but to use those you need to know/suspect that what you're debugging is an “async issue”.

Audit events are cheap (if unused), so I'd like to put it in even though the responses on Discourse were “meh”.

This audit event is not really security-related, but Steve said he wouldn't oppose it going in.

Linked PRs

Metadata

Metadata

Assignees

Labels

type-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions