Skip to content
  • Rob Swindell's avatar
    bff68ad0
    Check max_files value in extract_files_from_archive() better · bff68ad0
    Rob Swindell authored
    Address issue reported by Nightfox via DOVE-Net:
    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.   
    bff68ad0
    Check max_files value in extract_files_from_archive() better
    Rob Swindell authored
    Address issue reported by Nightfox via DOVE-Net:
    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.   
Loading