Opened 13 years ago

Last modified 4 years ago

#280 enhancement new

Deprecate twisted.internet.utils

Reported by: itamarst Owned by:
Priority: low Milestone:
Component: core Keywords:
Cc: radix, Jean-Paul Calderone, itamarst, Thijs Triemstra, Glyph Branch:


Change History (12)

comment:1 Changed 13 years ago by itamarst

utils modules are ick.

1. Move process stuff to twisted.runner somewhere.
2. Move SRV stuff into twisted.names, twisted.internet
modules should not depend on external packages.

comment:2 Changed 13 years ago by Moshe Zadka

The great downgrading.
Utils modules are ick, but not a bug.

comment:3 Changed 12 years ago by radix

#2 now lives in #772.

comment:4 Changed 12 years ago by radix

twisted.runner isn't an option any more. How about another suggestion?


comment:5 Changed 12 years ago by itamarst

We probably should have some place for process utilities, yes, cause there are a
number of common cases people tend to want.

comment:6 Changed 12 years ago by Jean-Paul Calderone

I don't know what to do with this.  The best thing I can think of is to delete
the module and pretend it never existed.  The functions it provides are
haphazard at best.

comment:7 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added

This one looks like it's still under 'active' development though.

comment:8 Changed 8 years ago by Jean-Paul Calderone

The things in twisted.internet.utils are icky. I think everything in it should be deprecated, then the module should be removed. Some of the APIs it contains provide some functionality, so something better should be provided for those before they're deprecated:

  1. getProcessOut / getProcessValue / getProcessOutputAndValue - these are sort of useful, except they're all too broken to use in most serious programs. The problems they have:
    1. Three different APIs for doing the same thing but getting a different return value. Pointless. Should be one API that can return any of the information.
    2. Very bad error handling. For example, sometimes you get back a Deferred which errbacks with a tuple. That shouldn't even be possible.
    3. No timeout support. The underlying transport isn't even exposed, so you can't implement timeouts on top of the API.
    4. No incremental result support. This might be out of scope for these utilities, but it's frequently the case that you want to process results as they come. Being able to get a producer or specify a consumer here would be sensible.
    5. No way to specify most of the parameters to spawnProcess - eg, cannot set up custom FDs.
    6. Bad result reporting. eg, getProcessOutput mixes stdout and stderr together. Unless you set errortoo, then it freaks out at the first sign of stderr (and you generally get a truncated worthless message that tells you only that something went wrong, not what).
  2. runWithWarningsSuppressed / suppressWarnings - these are trying to provide additional functionality for the Python warnings module. If we want it, we should try submitting patches to the stdlib. And the Deferred thing doesn't make any sense at all. You can't manage shared mutable resources that way. Twisted uses these a bit, but probably in ways which can be eliminated or changed to use some other API.

comment:9 Changed 7 years ago by Jean-Paul Calderone

See also #3997

comment:10 Changed 7 years ago by Thijs Triemstra

Cc: Glyph added
Summary: Kill twisted.internet.utilsDeprecate twisted.internet.utils

comment:11 Changed 6 years ago by <automation>

Owner: itamarst deleted

comment:12 Changed 4 years ago by Jean-Paul Calderone

As a further note on how getProcessOutputAndValue is broken, note that you cannot raise a tuple, so combining the Deferred it returns with any of the Failure-into-exception APIs (inlineCallbacks, blockingCallFromThread) results in broken behavior.

Note: See TracTickets for help on using tickets.