Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8413297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:53:35+00:00 2026-06-10T00:53:35+00:00

I need to verify if an widget which basically is a .zip are according

  • 0

I need to verify if an widget which basically is a .zip are according to this compliance rules:
http://www.w3.org/TR/widgets/#zip-archive

So what I need is to be able to check in that archive:

  • Compression Methods;
  • Version of Zip Needed to Extract a File Entry;
  • Zip Relative Paths (path lengths, character encoding, filenames)

What would be the way to approach this from python(what lib to use, some minimal code example would help)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:53:37+00:00Added an answer on June 10, 2026 at 12:53 am

    you should use the zipfile lib – try this http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/zipfile/index.html:

    To test if the file is a zip file:

    import zipfile
    
    for filename in [ 'README.txt', 'example.zip', 
                      'bad_example.zip', 'notthere.zip' ]:
        print '%20s  %s' % (filename, zipfile.is_zipfile(filename))
    

    And to access the info of a zip file:

    import datetime
    import zipfile
    
    def print_info(archive_name):
        zf = zipfile.ZipFile(archive_name)
        for info in zf.infolist():
            print info.filename
            print '\tComment:\t', info.comment
            print '\tModified:\t', datetime.datetime(*info.date_time)
            print '\tSystem:\t\t', info.create_system, '(0 = Windows, 3 = Unix)'
            print '\tZIP version:\t', info.create_version
            print '\tCompressed:\t', info.compress_size, 'bytes'
            print '\tUncompressed:\t', info.file_size, 'bytes'
            print
    
    if __name__ == '__main__':
        print_info('example.zip')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to verify if the args are valid file names, is this the
I have a string which I need to verify if it's a Country code.
I need to verify input which is like en-US or en-us or ar-AE I
Hello all and thanks for your time reading this. I need to verify certificates
I just need to verify that this regex statement will do what I want.
This might sound dumb, but I need to verify one thing. Does it mean
I need to verify something for which I have doubts. If a shared library
I'm using browser automation for testing web sites but I need to verify HTTP
I need to verify a signature of a message which contains several values. The
Basically I need to verify that a certain program is not running before installation.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.