Try - Except : ignored!

Askari 9974331 at cvm.qc.ca
Wed Dec 31 08:55:13 EST 2003


9974331 at cvm.qc.ca (Askari) wrote in news:104c369a.0312310225.551d4d16
@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()"...




More information about the Python-list mailing list