Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing Zipfiles
#2
on line 34 you have break. Once you eneter the except block you will break out of the loop. You don't need the break.
You need to put the rest of the code in else part

i.e.
try:
    # code that may cause error
except BadZipdile:
    # handle the bad zip file
    # lines 24-33
else:
    # code for case when no exception occur
    # lines 36-45
tester_V likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Testing Zipfiles - by millpond - Jan-08-2021, 07:55 PM
RE: Testing Zipfiles - by buran - Jan-08-2021, 08:08 PM
RE: Testing Zipfiles - by millpond - Jan-09-2021, 09:11 AM
RE: Testing Zipfiles - by Gribouillis - Jan-09-2021, 09:18 AM
RE: Testing Zipfiles - by buran - Jan-09-2021, 09:26 AM
RE: Testing Zipfiles - by Gribouillis - Jan-09-2021, 10:00 AM
RE: Testing Zipfiles - by wavic - Jan-10-2021, 01:37 PM
RE: Testing Zipfiles - by millpond - Jan-11-2021, 10:44 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020