stack dump in twisted app.py 'application' error when using twistd but works with python? -
i trying use twisted when try run of example code provided twisted package, seems crash when use "twistd" instead of "python"
for example, using example code given twisted, if run command : twisted -ny echoserv.py
unhandled error traceback (most recent call last): file "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 652, in run runapp(config) file "/usr/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 23, in runapp _someapplicationrunner(config).run() file "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 386, in run self.application = self.createorgetapplication() file "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 451, in createorgetapplication application = getapplication(self.config, passphrase) --- --- file "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 462, in getapplication application = service.loadapplication(filename, style, passphrase) file "/usr/lib/python2.7/site-packages/twisted/application/service.py", line 405, in loadapplication application = sob.loadvaluefromfile(filename, 'application', passphrase) file "/usr/lib/python2.7/site-packages/twisted/persisted/sob.py", line 211, in loadvaluefromfile value = d[variable] exceptions.keyerror: 'application' failed load application: 'application' not find 'application' in file. use 'twistd -y', .tac file must create suitable object (e.g., calling service.application()) , store in variable named 'application'. twistd loads .tac file , scans global variables 1 of name. please read 'using application' howto details.
i using twisted version 11.0.0 tried 12.0.0 have same problem.
the version of python using 2.7.2
any ideas on helpful. have been trying deal problem few days now. thanks!
twistd -y
meant used python file contains variable called application
, there none in file, it's not going work.
you might want spend time reading twistd
's documentation clearer idea of role in twisted
ecosystem.
Comments
Post a Comment