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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:02:43+00:00 2026-05-30T12:02:43+00:00

I am trying to data a data array created in Python3.2, pickle it, and

  • 0

I am trying to data a data array created in Python3.2, pickle it, and then open it in Python2.7. However, there is some part of the data that Python2.7 is objecting to, even though on a sample of the data it does fine, and I was wondering how to figure out what was going wrong.

So in Python3.2:

import pickle
with open('c:\\test.pickle', mode='wb') as f:
    pickle.dump(t_array, f, 2)

Then, when reading in Python2.7:

import pickle
f = open('c:\\test.pickle', mode='rb')
t_data = pickle.load(f)

The error is:

File "C:\Python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
File "C:\Python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
File "C:\Python27\lib\pickle.py", line 1217, in load_build
    setstate(state)
TypeError: must be char, not unicode

The data is an array of dicts, nested at most two deep, e.g:

{'key3': '3', 'key2': 1.1, 'key1': 1, 'dict': {'dkey2': 2, 'dkey1': 1}}

What’s (probably) going wrong here? Is there any easy way to see what in the original (large) dataset is causing the problem?

  • 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-05-30T12:02:44+00:00Added an answer on May 30, 2026 at 12:02 pm

    Pickle isn’t as good as it might look like. Security vulnerabilities and many issues like these.

    A much better idea is to create your own save format, for example using json.

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

Sidebar

Related Questions

I have a model that I'm trying to retrieve an array of data from,
I am trying to decide on a data structure for an array that has
I'm trying to implement some data structures (like HAMP-hash array mapped trie) in Common
I'm trying to store some data in the array call holder and the problem
I am trying the create a loop to extract data from an array created
Im trying to pass to another xib some data of NSMutableArray. I created a
I am trying to uncompress some data created in VB6 using the zlib API.
I am trying to return an array Data Member from one smaller 2D Array
I have two arrays of data that I'm trying to amalgamate. One contains actual
Im trying push some data into a CRM system via an XML import. I

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.