Opened 10 years ago

Last modified 10 years ago

#5424 enhancement new

unregisterProducer should check that a producer was actually registered, alert someone if one wasn't

Reported by: Stefano Debenedetti Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description (last modified by Jean-Paul Calderone)

twisted.internet.abstract._ConsumerMixin.unregisterProducer succeeds regardless of whether a producer was registered before or not. This lets errors pass silently.

The behavior is also inconsistent with that of the testing implementation of a consumer, twisted.test.proto_helpers.StringTransport. Though it's probably fine for testing implementations to impose stricture correctness checks, the difference may confuse or surprise some people, and this correctness check is not particularly expensive to perform.

Change History (1)

comment:1 Changed 10 years ago by Jean-Paul Calderone

Description: modified (diff)
Summary: Mismatch between StringTransport.unregisterProducer and _ConsumerMixin.unregisterProducerunregisterProducer should check that a producer was actually registered, alert someone if one wasn't
Type: defectenhancement
Note: See TracTickets for help on using tickets.