473,618 Members | 3,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sys.excepthook and threads

ian
Hi,

sys.excepthook don't work if an exception come in a thread...
It's normal or its a bug ? There are any tip ? look here :
http://spyced.blogspot.com/2005_06_01_archive.html

Thx
Mar 27 '07 #1
1 1925
ian schrieb:
Hi,

sys.excepthook don't work if an exception come in a thread...
It's normal or its a bug ? There are any tip ? look here :
http://spyced.blogspot.com/2005_06_01_archive.html

Thx
I think sys.excepthook is a thread local variable. This means the
variable has to be set by the thread for which it should be active.

You did set sys.excepthook in your main thread. This setting is not
propagated to your newly created thread.

This is my observation...

Peer

Apr 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7309
by: Follower | last post by:
Hi, I've run into an issue which seems to have been discussed previously on `python-dev` but only in context of Zope3: "Fun with 2.3 shutdown" -- Tim Peters <http://mail.python.org/pipermail/python-dev/2003-September/038151.html> The following message is displayed (one or more times) when exiting (in this case via a `KeyboardInterrupt` exception) a multi-threaded
1
2265
by: Josh Close | last post by:
When sys.excepthook is called, type, value and traceback are passed into it. How do I get the values of traceback? I've tried printing it, but I get the memory location. I'm gussing there are some methods to use on it. >From what I can tell the traceback that's passed in works differently from the module traceback. I just need to get the traceback to log it. I can use type and value,
6
4435
by: Lunchtimemama | last post by:
Yo all, I'm getting into Python for the first time and I'm really having a blast. I've hit a bit of a snag and was wondering if someone could lend some insight. Here be the code: import sys def myexcepthook(type, value, tb): import traceback rawreport = traceback.format_exception(type, value, tb) report = '\n'.join(rawreport) errorlog = open('error.log','a')
1
7966
by: Jesus Rivero - (Neurogeek) | last post by:
Hello guys, I have this problem and i don't know any workarounds yet. Im implementing a DB Connection pool, which initially creates 20 connections and keep them in a dictionary. It also implements a method for allowing external method/classes to get a connection from that pool. he main issue is that, from a testing app, I create a loop like this to test the pool: import thread
0
1094
by: Pramod TK | last post by:
Hi, Sometimes during execution of python scripts below mentioned error string is displayed on the console. "Unhandled exception in thread started by Error in sys.excepthook: Original exception was:" The scripts are not terminated, they continue to execute normally. Is this is a problem with python? Is there any known solution. I am using Python 2.4. Thanks in Advance
1
2219
by: Hari Sekhon | last post by:
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something sys.excepthook=myexcepthook rest of script.... (now protected by catchall exception hook)
0
1139
by: Larry Bates | last post by:
I have some classes that trap hook sys.excepthook and log exceptions prior to the program exiting. This has proven to be an effective way to log what is going on with many of my "lights out" processes. I'm doing some testing with Python 2.5b2 and can't seem to get it to work properly. Here is a very small script that I think should work but doesn't. import sys
1
1813
by: Hari Sekhon | last post by:
Hi, I'm wondering if anyone can please help me on figuring out a better way of doing an excepthook. I have a script which is using an excepthook to catch any uncaught exceptions - there usually aren't any except when I am messing with the code, like right now :-) The problem is that the excepthook gives the line of the topmost called function rather that the actual line that generated the error the way you get it with a normal...
3
2144
by: Sami | last post by:
Hello, I am new to Python. I tried to hook my own ExceptionPrintingFunction sys.excepthook but it does not work. This is what I wrote: ----------------------------------------------------------------------- import sys
0
8212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8595
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8304
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7126
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6101
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.