Re: [Twisted-Python] Reactor Spinning?

2010-05-05 Thread Itamar Turner-Trauring
> > I've confirmed that when spinning the FD corresponds with a client > connection. What would you suggest logging that might provide some > insight? What is the transport's writeSomeData() method doing? Is it actually trying to write an empty string? Transition from/to writeable state may also

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Chris Withers
Doug Farrell wrote: > > I’ve been doing some searching about how to get SQLAlchemy and Twisted > working together in a Twisted application. Short version: to be safe, anything that touches any SQLAlchemy-mapped object needs to be run in its own thread. Any query or access of an attribute of a

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Don Dwiggins
Doug Farrell wrote: > I’ve been doing some searching about how to get SQLAlchemy and Twisted > working together in a Twisted application. Though I’ve found a lot of > information, I haven’t seen (or figured out) a good working solution or > definitive answer. The most promising one I’ve run acro

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 4:54 PM, Itamar Turner-Trauring wrote: > On Wed, 2010-05-05 at 16:47 +0200, Pet wrote: >> Now, I'm getting Exception with >> >>           File >> "/usr/local/tw10/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-x86_64.egg/twisted/python/log.py", >> line 555, in write

Re: [Twisted-Python] print unicode

2010-05-05 Thread Itamar Turner-Trauring
On Wed, 2010-05-05 at 16:47 +0200, Pet wrote: > Now, I'm getting Exception with > > File > "/usr/local/tw10/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-x86_64.egg/twisted/python/log.py", > line 555, in write > d = (self.buf + data).split('\n') > exceptions

Re: [Twisted-Python] Reactor Spinning?

2010-05-05 Thread Phil Mayers
On 05/05/10 15:22, Moxie Marlinspike wrote: > > I've confirmed that when spinning the FD corresponds with a client > connection. What would you suggest logging that might provide some insight? > > Given what I understand about manholes, the fact that this only occurs > in a production environment

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 4:29 PM, Pet wrote: > On Wed, May 5, 2010 at 4:15 PM, Pet wrote: >> On Wed, May 5, 2010 at 2:49 PM, Itamar Turner-Trauring >> wrote: >>> On Wed, 2010-05-05 at 13:45 +0200, Pet wrote: Hello! I'm using Twisted 10.0 and as usually sometime print debug infos wit

Re: [Twisted-Python] print unicode

2010-05-05 Thread Itamar Turner-Trauring
On Wed, 2010-05-05 at 16:15 +0200, Pet wrote: > If I print as you do it works, but my string is fetched from database > and only then it fails Strings coming out of the database are usually just strings. There's nothing database (or Twisted) specific about them.

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 4:15 PM, Pet wrote: > On Wed, May 5, 2010 at 2:49 PM, Itamar Turner-Trauring > wrote: >> On Wed, 2010-05-05 at 13:45 +0200, Pet wrote: >>> Hello! >>> >>> I'm using Twisted 10.0 and as usually sometime print debug infos with >>> myunicodestr.encode('UTF-8') which are saved t

Re: [Twisted-Python] Reactor Spinning?

2010-05-05 Thread Moxie Marlinspike
I've confirmed that when spinning the FD corresponds with a client connection. What would you suggest logging that might provide some insight? Given what I understand about manholes, the fact that this only occurs in a production environment which must remain high performance means that might no

Re: [Twisted-Python] Reactor Spinning?

2010-05-05 Thread Moxie Marlinspike
Hey Itamar, the problem is that this only occurs under heavy load in a production environment (of course!), so I don't really have any way of testing a simplified version. The code itself is fairly simple, however, and is almost identical to the code that ships in twisted.web.proxy. This is to s

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 2:49 PM, Itamar Turner-Trauring wrote: > On Wed, 2010-05-05 at 13:45 +0200, Pet wrote: >> Hello! >> >> I'm using Twisted 10.0 and as usually sometime print debug infos with >> myunicodestr.encode('UTF-8') which are saved to logfile, but since >> using twisted 10 I'm getting

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 2:47 PM, Phil Mayers wrote: > On 05/05/10 13:31, Pet wrote: >> On Wed, May 5, 2010 at 2:05 PM, Maarten ter Huurne >>  wrote: >>> On Wednesday 05 May 2010, Pet wrote: >>> I'm using Twisted 10.0 and as usually sometime print debug infos with myunicodestr.encode('UTF

[Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Doug Farrell
Hi all, I've been doing some searching about how to get SQLAlchemy and Twisted working together in a Twisted application. Though I've found a lot of information, I haven't seen (or figured out) a good working solution or definitive answer. The most promising one I've run across concerns running

Re: [Twisted-Python] print unicode

2010-05-05 Thread Itamar Turner-Trauring
On Wed, 2010-05-05 at 13:45 +0200, Pet wrote: > Hello! > > I'm using Twisted 10.0 and as usually sometime print debug infos with > myunicodestr.encode('UTF-8') which are saved to logfile, but since > using twisted 10 I'm getting > > UnicodeEncodeError: 'ascii' codec can't encode characters... >

Re: [Twisted-Python] print unicode

2010-05-05 Thread Phil Mayers
On 05/05/10 13:31, Pet wrote: > On Wed, May 5, 2010 at 2:05 PM, Maarten ter Huurne > wrote: >> On Wednesday 05 May 2010, Pet wrote: >> >>> I'm using Twisted 10.0 and as usually sometime print debug infos with >>> myunicodestr.encode('UTF-8') which are saved to logfile, but since >>> using twisted

Re: [Twisted-Python] print unicode

2010-05-05 Thread Pet
On Wed, May 5, 2010 at 2:05 PM, Maarten ter Huurne wrote: > On Wednesday 05 May 2010, Pet wrote: > >> I'm using Twisted 10.0 and as usually sometime print debug infos with >> myunicodestr.encode('UTF-8') which are saved to logfile, but since >> using twisted 10 I'm getting >> >> UnicodeEncodeError

Re: [Twisted-Python] print unicode

2010-05-05 Thread Maarten ter Huurne
On Wednesday 05 May 2010, Pet wrote: > I'm using Twisted 10.0 and as usually sometime print debug infos with > myunicodestr.encode('UTF-8') which are saved to logfile, but since > using twisted 10 I'm getting > > UnicodeEncodeError: 'ascii' codec can't encode characters... UTF-8 uses the full 8

[Twisted-Python] print unicode

2010-05-05 Thread Pet
Hello! I'm using Twisted 10.0 and as usually sometime print debug infos with myunicodestr.encode('UTF-8') which are saved to logfile, but since using twisted 10 I'm getting UnicodeEncodeError: 'ascii' codec can't encode characters... type(myunicodestr) returns What is the problem here? Thank