473,287 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

how to print a traceback?

i'm struggling to get some proxy code working with liburl[2] and want
to print
some tracebacks in my class ProxyHTTPConnection::request().
do i have to force an exception and print a backtrace in catch or
can i just print the current stack?
print_tb takes an argument and short of forcing an exception
i don;t know where to get the current backtrace object from.

thanks.

Oct 16 '07 #1
1 5113
En Tue, 16 Oct 2007 01:03:08 -0300, <sn****@gmail.comescribi�:
i'm struggling to get some proxy code working with liburl[2] and want
to print
some tracebacks in my class ProxyHTTPConnection::request().
do i have to force an exception and print a backtrace in catch or
can i just print the current stack?
print_tb takes an argument and short of forcing an exception
i don;t know where to get the current backtrace object from.
from traceback import print_stack
print_stack()
--
Gabriel Genellina

Oct 16 '07 #2

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

Similar topics

3
by: Rim | last post by:
Hi, >>> print '%x' % 54 36 >>> print '%b' % 54 Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: unsupported format character 'b' (0x62) at index 1 >>>
3
by: Robert | last post by:
Python doesn't know the class of a method when container not direct class attribute: >>> class X: .... def f():pass .... g=f .... l= .... >>> X.g <unbound method X.f>
1
by: Art | last post by:
Hello, I can't seem to get eval or compile to accept the print stmt, or any complicated statements. The documentation I've looked out doesn't explain why this is. ex: >>>...
4
by: anonymousnerd | last post by:
Hi all, In Python, some functions can be assigned to variables like this: length=len Why is it that print cannot be assigned to a variable like this? (A syntax error is declared.) Thanks, ...
5
by: Saizan | last post by:
In an event-driven application i'd like to keep the program alive regardless of any exceptions raised by the handlers, but still be able to debug them by reading the appropriate TraceBack from...
2
by: Gary Wessle | last post by:
I am going through this tut from http://ibiblio.org/obp/thinkCS/python/english/chap07.htm I am getting errors running those 2 groups as below as is from the tut thanks index = 0
15
by: Jim B. Wilson | last post by:
Am I nuts? Or only profoundly confused? I expected the this little script to print "0": class foo(int): def __init__(self, value): self = value & 0xF print foo(0x10) Instead, it prints...
3
by: AWasilenko | last post by:
I'm still in the process of learning python via a handful of books I bought. One book I am reading just introduced Base Class Methods. I found that I needed more understanding on this concept and...
7
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post by:
Who could explain the follow issue ? ¦¤ Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeEncodeError: 'gbk' codec can't encode character u'\x80' in position 0: il...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.