• Archive.extract() with max_files parameter

    From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, August 02, 2022 09:29:51
    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 Tuesday, August 02, 2022 17:20:45
    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 Wednesday, August 03, 2022 09:00:23
    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)".

    I can see how that would be surprising behavior. I just committed a 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