473,396 Members | 1,893 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,396 software developers and data experts.

Try - Except : ignored!

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.
Jul 18 '05 #1
1 2040
99*****@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()"...
Jul 18 '05 #2

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

Similar topics

10
by: Margaret MacDonald | last post by:
I'm seeing a problem that has me flummoxed. The only thing I can think of is that I'm violating some rule I don't know about. I have some code that does some processing and then does a...
0
by: John J. Lee | last post by:
Bare "except:", with no exception specified, is nasty because it can easily hide bugs. There is a case where it seemed useful to me in the past. Now it seems like a bad idea to me (but I think...
29
by: | last post by:
I did a working code with CDONTS on NT4 Now I am testing is on w2k and it looks like objCDONTS.Send is completely ignored. I think is it ignored because it throws no errors, neither does the...
5
by: PJ6 | last post by:
I'm new to this, so please bear with me if this is a dumb question - In OnClick, this code is ignored - this.class='someclass' This is also ignored - ...
19
by: Alex Vinokur | last post by:
Is there any tool to count C-program lines except comments? Thanks, ===================================== Alex Vinokur mailto:alexvn@connect.to http://mathforum.org/library/view/10978.html...
9
by: Tim Cali | last post by:
I set a breakpoint in a project, however the breakpoint is ignored. This was in the TimeTracker project from the Asp.Net site. I added it at the Login method of the TTUser class (TTUser.vb). I...
7
by: Hallvard B Furuseth | last post by:
I'd like an 'except <exception which is never raised>' statement Is there a defined way to do that, for Python 2.2 and above? 'except None:' works for now, but I don't know if that's safe: for...
5
by: Nebur | last post by:
I'm using the contract.py library, running Python 2.4.4. Now I'm confronted with the following exception backtrace: (...) File "/usr/lib/python2.4/site-packages/contract.py", line 1265, in...
1
by: traceable1 | last post by:
I have a table with a unique non-clustered index on it. It has the IGNORE_DUP_KEY option on. For some reason, I am getting the following error: ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.