-
Archive.extract() with max_files parameter
From
Nightfox@VERT/DIGDIST to
Digital Man on Tue Aug 2 09:29:51 2022
Hi DM,ããToday I was using the Archive class to extract exactly one file from a zip file, and I'm a little confused on the exception throwing behavior regarding the max_files parameter. When calling extract(), I gave it a filename pattern and expected exactly 1 file to be extracted, so I also gave a max_files argument as 1. It extracted the one file, but it threw an exception with the error "Error: maximum number of files (1) extracted (after extracting 1 item successfully)".ããShould that be an error condition to throw an exception? I expected 1 file to be extracted, and that file was extracted successfully. If I specify max_files as 2, then it doesn't throw an exception.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Tue Aug 2 17:20:45 2022
Re: Archive.extract() with max_files parameterã By: Nightfox to Digital Man on Tue Aug 02 2022 09:29 amãã > Hi DM,ã >ã > Today I was using the Archive class to extract exactly one file from a zipã > file, and I'm a little confused on the exception throwing behavior regardingã > the max_files parameter. When calling extract(), I gave it a filenameã > pattern and expected exactly 1 file to be extracted, so I also gave aã > max_files argument as 1. It extracted the one file, but it threw anã > exception with the error "Error: maximum number of files (1) extractedã > (after extracting 1 item successfully)".ã >ã > Should that be an error condition to throw an exception? I expected 1 fileã > to be extracted, and that file was extracted successfully. If I specifyã > max_files as 2, then it doesn't throw an exception.ããI can see how that would be surprising behavior. I just committed a change. Let me know how that works for you.ã-- ã digital man (rob)ããBreaking Bad quote #22:ãI got one more shot at that little skid mark. - Hank SchraderãNorco, CA WX: 87.3øF, 35.0% humidity, 12 mph SSE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Wed Aug 3 09:00:23 2022
Re: Archive.extract() with max_files parameterã By: Digital Man to Nightfox on Tue Aug 02 2022 05:20 pmãã >> a filename pattern and expected exactly 1 file to be extracted, so Iã >> also gave a max_files argument as 1. It extracted the one file, butã >> it threw an exception with the error "Error: maximum number of filesã >> (1) extracted (after extracting 1 item successfully)".ãã DM> I can see how that would be surprising behavior. I just committed aã DM> change. Let me know how that works for you.ããI've updated, and now it doesn't throw an exception for this case. Thanks.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã