Try - Except : ignored!

A

Askari

Hi,

In my program (too long for cut-paste) :
http://www.cvm.qc.ca/9974331/Temp/crypte.py

When I run and click on the button "Crypter!", a thread is run for the
method "def crypte():" (line 118). After, because the field "txtCode"
is blank, I raise a error (line 136). The code continu in the except
at line 353. In this except block, Python ignore (I don't know how!)
one of two "try - except" (line : 354-360 or 362-365) and raise a
error and go out of try-except (but it's in a try except!).

When I run my code with no change, this error come :
============
Traceback (most recent call last):
File "C:\Documents and Settings\Assembleur_Man\Bureau\Crypte.py",
line 363, in crypte
os.remove(destination)
OSError: [Errno 2] No such file or directory: ''
============

and if I remove the second try-except (lines 362-365), I have this
error message :
============
Traceback (most recent call last):
File "C:\Documents and Settings\Assembleur_Man\Bureau\Crypte.py",
line 355, in crypte
fileDest.close()
NameError: global name 'fileDest' is not defined
============

Askari

Note : I try my code with python 2.3.3, 2.3.2 and 2.2.3. I have always
this bug.
 
A

Askari

(e-mail address removed) (Askari) wrote in @posting.google.com:
Hi,

In my program (too long for cut-paste) :
http://www.cvm.qc.ca/9974331/Temp/crypte.py

When I run and click on the button "Crypter!", a thread is run for the
method "def crypte():" (line 118). After, because the field "txtCode"
is blank, I raise a error (line 136). The code continu in the except
at line 353. In this except block, Python ignore (I don't know how!)
one of two "try - except" (line : 354-360 or 362-365) and raise a
error and go out of try-except (but it's in a try except!).

When I run my code with no change, this error come :
============
Traceback (most recent call last):
File "C:\Documents and Settings\Assembleur_Man\Bureau\Crypte.py",
line 363, in crypte
os.remove(destination)
OSError: [Errno 2] No such file or directory: ''
============

and if I remove the second try-except (lines 362-365), I have this
error message :
============
Traceback (most recent call last):
File "C:\Documents and Settings\Assembleur_Man\Bureau\Crypte.py",
line 355, in crypte
fileDest.close()
NameError: global name 'fileDest' is not defined
============

Askari

Note : I try my code with python 2.3.3, 2.3.2 and 2.2.3. I have always
this bug.

Batheme! I didn't know that the exception rest in memory after a "catch".
Finaly, it's my mistake with use of "sys.exc_info()"...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,485
Latest member
Andrewayne909

Latest Threads

Top