Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6386789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:04:14+00:00 2026-05-25T03:04:14+00:00

I’m just learning to write applications on Twisted and so do a lot of

  • 0

I’m just learning to write applications on Twisted and so do a lot of mistakes.

Suppose there is a code:

d = defer.Deferred()
d.addCallback(self.start_app)
#d.addErrback(self.command_die)
d.callback(0)

def start_app(self, d):
    #import os
    return os.startfile(self.path)

def command_die(self, d):
    print ('com_die', d)

We have error in os.startfile(self.path) and Big Traceback:

Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 542, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "C:/Dropbox/my_py/client3.py", line 100, in command_analiz
    d.callback(i)
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 361, in callback
    self._startRunCallbacks(result)
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 455, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 542, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "C:/Dropbox/my_py/client3.py", line 353, in start_eve_d
    return os.startfile(self.path)
exceptions.NameError: global name 'os' is not defined

If I uncomment #d.addErrback(self.command_die)

We have little “log” create by print (‘com_die’, d):

('com_die', <twisted.python.failure.Failure <type 'exceptions.NameError'>>)

Is there a way to get the full Log \ TraceBack on design time?

At the moment I to understand where there was a new error, it is necessary to comment addErrorback `s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:04:14+00:00Added an answer on May 25, 2026 at 3:04 am

    Twisted Failure object has everything you need.
    For getting nice traceback try using printTraceback() method:

    >>> from twisted.internet.defer import Deferred as D
    >>> def start_app(_):
    ...     #import os
    ...     return os.startfile('sasa')
    ... 
    ... def command_die(err):
    ...     err.printTraceback()
    ... 
    ...     
    ... d = D()
    ... d.addCallback(start_app)
    ... d.addErrback(command_die)
    ... d.callback(0)
    Traceback (most recent call last):
      File "C:\Users\Pilyavskiy\AppData\Local\DreamPie\share\dreampie\subp-py2\dreampielib\subprocess\__init__.py", line 324, in execute
        exec codeob in self.locs
      File "<pyshell#3>", line 12, in <module>
        d.callback(0)
      File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 361, in callback
        self._startRunCallbacks(result)
      File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 455, in _startRunCallbacks
        self._runCallbacks()
    --- <exception caught here> ---
      File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 542, in _runCallbacks
        current.result = callback(current.result, *args, **kw)
      File "<pyshell#3>", line 3, in start_app
        return os.startfile('sasa')
    exceptions.NameError: global name 'os' is not defined
    

    Look for other options in source http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/python/failure.py#L121 it’s pretty well commented.

    PS: Name d is mostly used for deferred itself, for result/error it’s better to use something like res/err etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have this code to decode numeric html entities to the UTF8 equivalent character.
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
For some reason, after submitting a string like this Jack’s Spindle from a text
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.