[Twisted-Python] Getting deprecation warnings?

Glyph glyph at twistedmatrix.com
Wed Sep 5 17:10:29 EDT 2012

On Sep 5, 2012, at 1:08 PM, exarkun at twistedmatrix.com wrote:

> On 07:55 pm, glyph at twistedmatrix.com wrote:
>> On Sep 5, 2012, at 12:11 PM, exarkun at twistedmatrix.com wrote:
>>> On 06:41 pm, _ at lvh.cc wrote:
>>>> Hey,
>>>> What is the appropriate way to run twistd apps in such a way that I 
>>>> get
>>>> nice and loud deprecation warnings?
>>> 1) Have complete unit test coverage and run your tests with trial. 
>>> All
>>> deprecation warnings will be written out as part of the test suite 
>>> run.
>>> 2) Run twistd with Python 2.6
>>> 3) Run twistd with Python 2.7 and pass "-W::DeprecationWarning:"
>> A note for posterity - if we are ever to implement a generalized 'run 
>> an inferior twistd process', or even 'run an inferior python 
>> interpreter' mechanism, warning information like this is one of the 
>> bits of runtime state that ought to be communicated.
> It would be nice if Python preserved its own command-line arguments 
> somewhere, but it doesn't seem to. :/  So figuring out what the runtime 
> state is is somewhat non-trivial in this case.  Otherwise, I completely 
> agree.

Yeah, that's kinda why I specifically pointed it out.  There are a number of command-line arguments which we should preserve if we can, but some (python -u, I think?) are lost to us entirely.  Warning disposition though, is especially important, given that users might be running subprocesses and we should report warnings in code that is covered that way too.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120905/7eb9d488/attachment.htm 

More information about the Twisted-Python mailing list