Re: [Twisted-Python] Accessing the request object from a different thread

2010-01-16 Thread Phil Mayers
> 
> All of the accesses to the request object are read operations.  If
> those read operations occur on data that does not get messed with by
> the main thread, then this should be thread-safe code.  However, it
> seems that the official word is "do not use request objects from other
> threads."  Maybe I am mistaken.  In any case, is there a safe way to
> get at request headers and parameter values outside of the reactor
> loop.

The rule is not to call any twisted functions IIRC.

You can do this safely:

   args_copy = dict(request.args)
   hdr_copy = dict(request.requestHeaders.getAllRawHeaders())
   deferToThread(func, args_copy, hdr_copy)

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Weekly Bug Summary

2010-01-16 Thread exarkun



Bug summary
__
Summary for 2010-01-10 through 2010-01-17
Bugs opened: 24Bugs closed: 14  Total open bugs: 1227 (+10)

|== Type Changes   |== Priority Changes   |== Component Changes 
|Defect:   +9  |High:+0   |Conch:   +1  
|Enhancement:  +3  |Normal: +13   |Core:+5  
|Task: -2  |Low: -2   |Lore:+0  
   |Lowest:  -1   |Names:   +2  
  |Release Management:  +1  
  |Trial:   +1  
  |Web: +1  
  |Website: +0  
  |Words:   -1  



Total Tickets
Open Tickets



New / Reopened Bugs
__
= High =
[#4211] Update status of Lore in documentation (opened by thijs) (CLOSED, wontfix)
tasklore   http://twistedmatrix.com/trac/ticket/4211

[#4223] twisted.web._newclient should not unconditionally send "Connection: close" (opened by dreid)
enhancement webhttp://twistedmatrix.com/trac/ticket/4223

= Normal =
[#4203] twisted/conch/test/test_recvline.py stdio loopback tests set up child environment in a problematic way (opened by exarkun)
defect  conch  http://twistedmatrix.com/trac/ticket/4203

[#4204] testing policy document recommends the wrong group of assert* methods (opened by exarkun) (CLOSED, fixed)
defect  core   http://twistedmatrix.com/trac/ticket/4204

[#4205] ftp_NLST returns paths with incorrect separators, should be a forward-slash (opened by jesstess)
defect  core   http://twistedmatrix.com/trac/ticket/4205

[#4206] twisted.internet.test.test_fdset fails on OpenBSD because connect() succeeds (opened by soyt)
defect  core   http://twistedmatrix.com/trac/ticket/4206

[#4207] Assorted code in Twisted passes a mode including "b" to FilePath.open (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4207

[#4208] python setup.py install fails: OS X 10.6, Py 2.6.4 with GCC-4.0 error fp.h:1338: error: ‘SIGDIGLEN’ undeclared here (not in a function) (opened by ssteiner)
defect  core   http://twistedmatrix.com/trac/ticket/4208

[#4209] Bad link in docs/core/howto/quotes (opened by khorn) (CLOSED, fixed)
enhancement core   http://twistedmatrix.com/trac/ticket/4209

[#4210] twisted.names.common.extractRecord tries to disconnect a protocol with no transport (opened by exarkun)
defect  names  http://twistedmatrix.com/trac/ticket/4210

[#4212] Twisted names gives the wrong address family. (opened by ali)
defect  names  http://twistedmatrix.com/trac/ticket/4212

[#4213] Gaierrors can be badly presented making debugging difficult (opened by ali)
defect  core   http://twistedmatrix.com/trac/ticket/4213

[#4214] trial shouldn't drop _trial_temp in the directory in which it's run. (opened by ChrisW)
defect  trial  http://twistedmatrix.com/trac/ticket/4214

[#4215] trial --temp-directory= blows up (opened by ChrisW)
defect  trial  http://twistedmatrix.com/trac/ticket/4215

[#4216] Use setdefault in handleHeader (opened by johnnyg)
enhancement webhttp://twistedmatrix.com/trac/ticket/4216

[#4217] twisted.internet.test.test_posixbase leaks waker pipes (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4217

[#4218] twisted.vfs tests leak files (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4218

[#4219] twisted.python.threadpool instantiates Failures in a non-reactor thread (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4219

[#4220] add some active contributors (opened by thijs) (CLOSED, fixed)
taskcore   http://twistedmatrix.com/trac/ticket/4220

[#4221] test_acceptOutOfFiles mishandles particularly low-fd-availability conditions poorly (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4221

[#4222] API docs for `twisted.internet.stdio.StandardIO` missing (opened by exarkun)
defect  core   http://twistedmatrix.com/trac/ticket/4222

[#4224] Add .doc NEWS type (opened by thijs)
enhancement release management http://twistedmatrix.com/trac/ticket/4224

[#4225] Setup a lore2sphinx builder (opened by thijs)
enhancement websitehttp://twistedmatrix.com/trac/ticket/4225

[#4226] conch\telnet.py does not allow for Binary Transmission or End of Record (opened by kench)
enhancement conch  http://twistedmatrix.com/trac/ticket/4226



Closed Bugs
__
= Hig