hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
On Thursday, August 28, 2003, at 10:32 AM, itamarst CVS wrote:
> log stderr and non-zero exit code in CGIs, don't show info to users as
> it is a security risk (closes issue #241)
We shouldn't swallow errors in these situations. If it's a security
risk, provide a way for the server administrator to turn it off, but
this is a _bad_ default.
If you doubt the wisdom of making this default, please consult any
number of Perl FAQs of the form:
Q. "I wrote a CGI and it works perfectly, but now I moved it to
another server and I get nothing but a "500 Internal Server Error"
page. How do I tell what went wrong!?!?!?"
A. Look in your apache logs.
Q. "I looked at my apache logs and nothing makes sense! How do I tell
what the error was??!"
Also, could you clarify the security risk of displaying stderr from CGI
scripts? I've never heard of a CGI that puts security-critical
information on stderr rather than stdout and makes it a risk to display
Glyph Lefkowitz wrote:
> Oisin Mulvihill wrote:
>> I confess I really don't know how to handle the two deferred
>> object that get returned by storeFile. I just add callback/
>> errorback for each, this could be the problem.
> If you want to wait for both, use twisted.internet.defer.DeferredList.
Why are there two deferred objects returned by storeFile? The documentation
storeFile (self ,path ):
Store a file at the given path.
This method issues the 'STOR' FTP command.
A tuple of two Deferreds:
* Deferred IFinishableConsumer . You must call the finish method on the
IFinishableConsumer when the file is completely transferred.
* Deferred list of control-connection responses.
This really doesn't help me much. I get the impression that storeFile
isn't sending the contents of file, because its waiting for me to stream
the file contents somehow. Maybe via IFinishableConsumer?
In my current program, using ftplib, I do the following to upload a file:
ftp.storbinary('STOR %s' % (filename), fp)
This has the filename and a file descriptor passed to it. Is something
needed with storeFile?
Please can someone give me an answer to this, as looking at the code for
twisted.protocols.ftp isn't helping much either. This function seems to be
a mystery to me and I want to understand how to use it properly.
>> Can anyone enlighten me as to what I'm doing wrong. I would
>> really like to use proper async behavior for doing the uploads,
>> instead of using threads + ftplib.
> The FTP implementation in Twisted is sub-optimal (although that's
> mostly the server). If you don't get any satisfactory responses I
> recommend assigning a bug to spiv in the tracker :).
Engines Of Creation
Work: +353 1 6791602
Mobile: +353 868191540
I've had a twisted web application running for a while that
uses request.getUser() and request.getPassword() in a
resource subclass render() method to make the web browser
prompt for a username/password.
I've been refactoring this application to use Woven page
subclasses and the same request.getFoo() calls now
return empty strings rather than None, and no prompting
from the browser is done.
Is there some gotcha in using request.getUser() and
request.getPassword() from Woven page subclasses?
:: Stuart Hungerford (stuart.hungerford(a)anu.edu.au)
:: ANU Internet Futures Group
I have a form with a submit button. I want to send my data from the form in
a web page to an other web page. Also, I want to check if the data is
I'm new to twisted, so I need some help
MSN Messenger : discutez en direct avec vos amis !
I really need help.
I want to make a form dynamically. I don't want to use FormProcess and I do
not understand very well how it works. If someone have documentation on
forms (not the one on twisted matrix), it will be appreciated.
MSN Messenger : discutez en direct avec vos amis !
I've heard on this list that it is possible to use deferreds in
controllers. Let's say I have a page class that needs to load a
deferred object before any of it's wmfactory_ methods make any
sense. What I have done previously is to store the deferred and chain
new deferreds on every wmfactory method and return them instead of a
real value. If deferred in controlers work the way I hope I could load
the actual domain object from the deferred and store it in my page
class before any of the wmfactory methods are called which would be
So my question is how do I use a controller for this (if it is
possible). Btw. I've yet to upgrade to 1.1 because the application is
still using the old cred system.
I have a really big ASP/IIS-based system which I'm trying to (partially)
rewrite and evolve with python.
I've already wrote some useful code in using Cheetah/WebKit and now I'm
thinking about the best way to integrate it back into the legacy system.
As my python code depends on WebKit very little and Cheetah is a
standalone processor that could probably be plugged into Twisted easily
I'm evaluating the possibility to switch to Twisted.
There is nothing wrong with Webware/WebKit -- it is a great platform,
but I'd like to make use of some Twisted components, like
twisted.enterprise.row or twisted.cred.
If I'm to switch to Twisted what could you suggest for IIS-Twisted
I'm currently thinking about simple Response.Redirect('...') from .asp
to twisted.web. But I'd also like to share data and session's state
between the two. For example, to match twisted.web.server.Session with
IIS session. Dunno how this could be done though.
More promising (may be) but surely more complex way would be to write
some kind of IIS-Twisted adapter that uses COM to talk to VB and
twisted.spread to talk to Twisted.
What compiler doesn't support C99 comments yet?
On Oct 30, 2003, at 6:19 PM, exarkun CVS wrote:
> Modified files:
> Twisted/twisted/protocols/_c_urlarg.c 1.7 1.8
> Log message:
> THE EXTENSION IS .C! IT IS NOT A C++ FILE!
Itamar and others,
Sorry for the delayed reply and thank you for your constant help. I
setup my NT service as you described, importing the win32eventreactor and
installing it. The service starts up fine, but when I stop the service I
get the following in the logs. The "15:08 ... Unexpected..." entry only
gets dumped in the log when stopping the service.
I'm not sure how I'd go about debugging this more since I can't get
anymore output than what's dumped to the log. Any ideas? I've attached
winsvc.py and a couple other files it is dependent on.
2003/10/30 15:07 Eastern Standard Time [-] Log opened.
2003/10/30 15:07 Eastern Standard Time [-]
twisted.spread.pb.PBServerFactory starting on 8787
2003/10/30 15:07 Eastern Standard Time [-] Starting factory
<twisted.spread.pb.PBServerFactory instance at 0x00DF8D28>
2003/10/30 15:08 Eastern Standard Time [-] Unexpected error in main loop.
2003/10/30 15:08 Eastern Standard Time [-] Traceback (most recent call
File "E:\Python22\Lib\site-packages\win32\lib\win32serviceutil.py", line 635, in SvcRun
File "E:\ccase\python\winsvc.py", line 24, in SvcDoRun
File "E:\Python22\Lib\site-packages\twisted\internet\default.py", line 122, in run
--- <exception caught here> ---
File "E:\Python22\Lib\site-packages\twisted\internet\default.py", line 133, in mainLoop
File "E:\Python22\Lib\site-packages\twisted\internet\win32eventreactor.py", line 180, in doWaitForMultipleEvents
fd, action = events[handles[val - WAIT_OBJECT_0]]
----- Original message -----
From: "Itamar Shtull-Trauring" <itamar(a)itamarst.org>
Date: Wed, 22 Oct 2003 14:50:10 -0400
Subject: Re: [Twisted-Python] twistd and win32 service
On Wed, 22 Oct 2003 12:24:42 -0600
"Justin Johnson" <justinjohnson(a)fastmail.fm> wrote:
> The general consensus on the mailing list archives seems to be that
> I'd need to setup my code to not require twistd but just run
Uh. *Maybe* that's the consensus, but it's not actually correct. You can
have a tap or tac run as a NT service.
Lets say you have a script "server.py" that is runnable with "twistd
-y", you can do (and similar code will work for TAPs):
import sys, os
import win32serviceutil, win32service
_svc_name_ = "MyService"
_svc_display_name_ = "MyService server"
f = open(os.path.join(server.rootPath, "cyberhigh.log"), 'a')
from twisted.python.log import startLogging
from twisted.application.app import startApplication
from twisted.internet import reactor
from twisted.internet import reactor
if __name__ == '__main__':
Itamar Shtull-Trauring http://itamarst.org/
Available for Python & Twisted consulting
Twisted-Python mailing list