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 7884373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:46:55+00:00 2026-06-03T04:46:55+00:00

I have large (~75MB) pickled objects that are made available on mapped network drives

  • 0

I have large (~75MB) pickled objects that are made available on mapped network drives (eg: X:/folder1/large_pickled_item.pk)
The objects contain numpy arrays+python lists, and are pickled using cPickle, protocol 2

When I try to unpickle the data, I get the following error messages:

Using pickle:
KeyError: (random character)

Using cPickle:
IOError: [Errno 22] Invalid argument

I do not get errors if the pickled objects are smaller in size,
or if I copy the (larger) objects to a local drive and run the same script.

Any idea where the problem lies? Is it a python+pickle problem or a windows shares issue?

Notes:

  1. I am using Python 2.7.2 on Windows XP Professional (SP3)
  2. I do not have control over the object format, I do not create them, I can only read them
  3. Example stack Trace:

    File “test.py”, line 38, in getObject
    obj = pickle.load(input)
    File “C:\software\python\lib\pickle.py”, line 1378, in load
    return Unpickler(file).load()
    File “C:\software\python\lib\pickle.py”, line 858, in load
    dispatchkey
    KeyError: ‘~’

Solution

  1. Read the file in chunks of 67076095 bytes into a string buffer.
  2. Call pickle.loads with the string buffer instead of pickle.load with the file object
  • 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-03T04:46:57+00:00Added an answer on June 3, 2026 at 4:46 am

    This is due to a Windows bug, whereby reading and writing network files in chunks larger than 64MB does not work.

    I suggest trying the mirror image of the workaround presented in https://stackoverflow.com/a/4228291/367273

    If that doesn’t help, perhaps you could create a wrapper for the file object that would automatically split every large read() into multiple smaller reads, and present that wrapper to the pickle module?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have large table (~1,000,000 rows) that may contain duplicates values. the table contain
I have large video files (~100GB) that are local on my machine. I have
I have large amounts of scientific data that I need to store (150 TB+
I have large Boost/Spirit metaprogram that is blowing gcc's stack when I try to
I have large zoomable bitmaps with text, that I want to resize a little
I have large batches of XHTML files that are manually updated. During the review
We have large sets (10+) of very large files (> 1 GB) that we
We have large C++ project that we used to compile with the /MP switch
I have large strings that resemble the following... some_text_token 24.325973 -20.638823 -1.964366 0.753947 -1.290811
We have large files with zlib-compressed binary data that we would like to memory

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.