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

  • SEARCH
  • Home
  • 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 8054049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:03:29+00:00 2026-06-05T08:03:29+00:00

How do I extract a zip to memory? My attempt (returning None on .getvalue()

  • 0

How do I extract a zip to memory?

My attempt (returning None on .getvalue()):

from zipfile import ZipFile
from StringIO import StringIO

def extract_zip(input_zip):
    return StringIO(ZipFile(input_zip).extractall())
  • 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-05T08:03:31+00:00Added an answer on June 5, 2026 at 8:03 am

    extractall extracts to the file system, so you won’t get what you want. To extract a file in memory, use the ZipFile.read() method.

    If you really need the full content in memory, you could do something like:

    def extract_zip(input_zip):
        input_zip=ZipFile(input_zip)
        return {name: input_zip.read(name) for name in input_zip.namelist()}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I extract zip code (US) from the following string? import re address
When I extract files from a ZIP file created with the Python zipfile module,
I need to extract the zip code from a string. The string looks like
I'm using this function to extract files from .zip archive and store it on
The purpose of this code is to pull upgrade.zip from a central server, extract
I use python's zipfile module to extract a .zip archive (Let's take this file
I have the following code which is executed from the command line: import cgi,time,os,json,sys,zipfile,urllib2
I am using the following code to extract a zip file in Java. import
I downloaded Haml from here: http://rubyforge.org/frs/?group_id=2760 . When I extract the zip there are
I'm trying to extract .zip files and I'm using this code: String zipFile =

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.