Don't know if this helps:
>>> chr(0x32) + chr(0x30) + chr(0x31) + chr(0x33) + chr(0x2d) + chr(0x31) +
chr(0x30) + chr(0x2d) + chr(0x31) + chr(0x36) + chr(0x20) + chr(0x31) +
chr(0x30) + chr(0x3a) + chr(0x31) + chr(0x31)
On Wed, Oct 16, 2013 at 1:14 PM,
> Send Twisted-Python mailing list submissions to
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
> You can reach the person managing the list at
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Twisted-Python digest..."
> Today's Topics:
> 1. Re: Garbage in logfiles? (Conor Sayres)
> 2. Re: Garbage in logfiles? (Christopher Armstrong)
> 3. Re: Garbage in logfiles? (Glyph)
> Message: 1
> Date: Wed, 16 Oct 2013 11:12:12 -0700
> From: Conor Sayres <sayresc(a)gmail.com>
> To: Twisted general discussion <twisted-python(a)twistedmatrix.com>
> Subject: Re: [Twisted-Python] Garbage in logfiles?
> Message-ID: <81DD4767-8F1E-4A55-857E-A7A61BE9E3D4(a)gmail.com>
> Content-Type: text/plain; charset="us-ascii"
> On Oct 16, 2013, at 10:44 AM, Christopher Armstrong <
> radix(a)twistedmatrix.com> wrote:
> > On Wed, Oct 16, 2013 at 12:33 PM, Conor Sayres <sayresc(a)gmail.com>
> > Hi All,
> > I'm working for an astro observatory and we are upgrading our telescope
> control software. We are swapping to twisted under the hood, and I have
> run into an issue regarding logging.
> > I have set up twisted logging to record all communication between our
> devices. When we simulate our system with a high frequency log rollover
> rate (~5 seconds), many of the logs contain only garbage. Here is an
> example of a few lines in a given bad log file:
> > 3230 3133 2d31 302d 3136 2031 303a 3131
> > 3a34 352d 3037 3030 205b 2d5d 2044 6576
> > 436d 6428 5354 4154 5553 290a 3230 3133
> > 2d31 302d 3136 2031 303a 3131 3a34 352d
> > 3037 3030 205b 2d5d 2044 6576 436d 6428
> > 5354 4154 5553 290a 3230 3133 2d31 302d
> > Here is an example of a few lines from a good log file:
> > 2013-10-16 10:11:39-0700 [_SocketProtocol,client] Galil Reply(XQ#STATUS)
> > 2013-10-16 10:11:39-0700 [-] Galil Reply(: 1, 1, 1, 1, 1 axis homed)
> > 2013-10-16 10:11:39-0700 [-] To All Users(1 1 i axisHomed=1, 1, 1, 1, 1)
> > 2013-10-16 10:11:39-0700 [-] Galil Reply(000000000, 000000000,
> 000000000, 000000000, 000000000 commanded position)
> > 2013-10-16 10:11:39-0700 [-] To All Users(1 1 i cmdMount=0, 0, 0, 0, 0)
> > 2013-10-16 10:11:39-0700 [_SocketProtocol,client] MirrorCtrl Reply(1 1 i
> axisHomed=1, 1, 1, 1, 1)
> > 2013-10-16 10:11:39-0700 [_SocketProtocol,client] Galil Reply(XQ#STATUS)
> > I haven't been able to reproduce the problem in a simpler framework than
> our simulation. I am triggering the rollover by directly calling
> LogFile.rollover on a timer. The problem also exists if I define a small
> file size limit for automatic rollover and let twisted do it automatically.
> > I don't think there's any method named "rollover" anywhere in Twisted
> (in fact, I just confirmed this with grep).
> I'm sorry, the method is rotate my mistake
> > Your message is pretty vague and context-free; could you try to add more
> necessary detail?
> > Is the problem with the output you're seeing the *content* of the
> numbers/letters, or just the fact that they're appearing at all? Maybe
> there's relevant output before or after that block of numbers/letters? Did
> you leave out the timestamp prefixes when pasting to this email, or is
> there really no timestamp prefixing the lines of that output?
> The bad log files are 100% full of non-relevant output. They contain no
> time stamps, solely lines of 4 character blocks (hex?). They should
> contain information like the example of a good log I showed above.
> The good log files are 100% full of relevant output, no corruption. They
> contain the timestamps (as they should).
> It seems somewhat random whether or not a given log file will be good or
> > I don't know where those numbers/letters could be coming from. Does your
> code (or any libraries you use) ever print to stdout? By default, Twisted
> redirects all prints (and any writing to sys.stdout) to the log file.
> The log was configured to NOT capture print statements to stdout.
> > --
> > Christopher Armstrong
> > http://radix.twistedmatrix.com/
> > http://planet-if.com/
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python(a)twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Crochet is an MIT-licensed library that makes it easier for blocking or
threaded applications like Flask or Django to use the Twisted networking
framework. Crochet provides the following features:
* Runs Twisted's reactor in a thread it manages.
* The reactor shuts down automatically when the process' main thread
* Hooks up Twisted's log system to the Python standard library logging
framework. Unlike Twisted's built-in logging bridge, this includes
support for blocking Handler instances.
* A blocking API to eventual results (i.e. Deferred instances). This
last feature can be used separately, so Crochet is also useful for
normal Twisted applications that use threads.
You can download Crochet at: http://pypi.python.org/pypi/crochet
Documentation can be found at: http://crochet.readthedocs.org
Bugs and feature requests should be filed at the project page:
*What's New in 0.9.0*
* Expanded and much improved documentation, including a new section
with design suggestions.
* New decorator @wait_for_reactor added, a simpler alternative to
* Refactored @run_in_reactor, making it a bit more responsive.
* Blocking operations which would otherwise never finish due to
reactor having stopped (EventualResult.wait() or @wait_for_reactor
decorated call) will be interrupted with a ReactorStopped exception.
* @run_in_reactor decorated functions (or rather, their generated
wrapper) are interrupted by Ctrl-C.
* On POSIX platforms, a workaround is installed to ensure processes
started by reactor.spawnProcess have their exit noticed. See Twisted
ticket 6378 <http://tm.tl/6738> for more details about the
AutobahnPython 0.6.3 was just released to PyPi https://pypi.python.org/pypi/autobahn with lots of new features, including _WebSocket compression_, an upcoming extension to the WebSocket protocol.
We have seen compression ratios of 2-15x with JSON payload over WebSocket, which is great, in particular for mobile and embedded devices / IoT!
AutobahnPython supports WS compression for both clients and servers, and with all knobs and options.
Besides AutobahnPython, the extension is currently implemented in Chromium (very near shipping in Chrome), WebSocket++ (client and server), pywebsocket (server only) and Jetty (server only, not yet released, partial implementation).
Complete list of new features is here:
PS: should it be frowned upon posting announcements like this, please let me know. If it's useful/ok, please let me know also - I am hesitating each time to do postings like this to the list ..
I am wondering how I should combine various twisted interfaces
in a way that makes sense. It probably shows here... that I'm new to
The Linux iptables can log packets to the netfilter_log which can give
access to user space.
I wrote a simple twisted Reader (IReadDescriptor implementation) that is
working functional code...
But since these are packets it returns... should I implement a "read only
The protocol's dataReceive() method could be called from the NFLogReader's
Does this mean that NFLogReader would be responsible for calling
buildProtocol to construct the NFLogProtocol?
In the normal Twisted examples the buildProtocol seems to be called from
the react loop..
Should I pass the protocol factory and the reader to the service?
If I want to drop privileges right after retrieving the filedescriptor for
netfilter_log, shall I use a Twisted Service/Application to drop the root
privs to a non-superuser?
Should the privileges be dropped by the privilegedStartService() method?
The manual says that method is for preparing to drop services...
What I want out of all of this is the most high performance and general
solution to utilizing netfilter_log in twisted...
txsocksx <https://pypi.python.org/pypi/txsocksx> 220.127.116.11 has been
released--the first stable 1.x release.
This version has full implementations of client endpoints which wrap
client endpoints and perform SOCKS 4, 4a, or 5 proxy negotiation.
Additionally, txsocksx comes with support code to allow HTTP requests to
be made over a SOCKS connection using Twisted's Agent API, and another
wrapper endpoint for performing TLS negotiation after proxy negotiation.
(The TLS wrapper endpoint will eventually land in twisted as a part of
<http://tm.tl/5642>, but are experimentally in txsocksx for now.)
Documentation is available on ReadTheDocs, including examples and an API
Thanks for reply.
I know SSCCE.... But I have not code yet. I'm doing some investigation to understand if it is the right way or if twisted has a better standard flow for a similar problem.
I will try to write something....
exarkun(a)twistedmatrix.com ha scritto:
>On 04:57 pm, s.danzi(a)hawai.it wrote:
>>I have to write a little python program to manage a serial port radio
>>I have to send some AT commands and read resposes. This is not a
>>twisted examples are enough.
>>...but I have a situation that makes things complicated:
>>Anytime the modem can send back to serial port a line starting with
>>I have to catch it and do some analysis that could take a long time.
>>How to solve????????????????
>Please read http://sscce.org/ and post again with more information.
>Twisted-Python mailing list