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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:45:46+00:00 2026-06-05T15:45:46+00:00

With plistlib I can serialize a dictionary / list structure into a plist. This

  • 0

With plistlib I can serialize a dictionary / list structure into a plist. This works ok and I can also read it back with the same library.

The problem is that dictionaries are of type “_internalDict” and I don’t seem to be able to change them. For exampl, for example:

d = plistlib.readPlist('someplist.plist')
v = d['value'] # v is an _internalDict
v['val'] = 'new val' # works
del v # doesn't work
v = {'someotherkey': 'someothervalue'} # doesn't work either

The plist doesn’t seem to change. 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-05T15:45:48+00:00Added an answer on June 5, 2026 at 3:45 pm

    You’ll need to delete the key from the d dict:

    del d['value']
    

    By setting v = d['value'] you are only creating a new variable that points to the same value as d['value'], but deleting v will not remove the dict from the parent structure.

    To replace the dict altogether, you again need to manipulate the parent dict:

    d['value'] = { 'foo': 'bar' }
    

    If you execute v = { ... } what you are doing is assigning a reference to a new dict value to the variable v, replacing the reference to the d['value'] dict; you are not manipulating the original value in the d dict.

    plistlib._InternalDict is just a subclass of dict that gives warnings for attribute access, which is now deprecated; otherwise it acts just like a regular dict type.

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

Sidebar

Related Questions

I'd like to serialize Python objects to and from the plist format (this can
Hopefully a quick python question here... import plistlib pl = plistlib.readPlist('/Users/name/Documents/some.plist') print(pl[0]['keyA'] , pl[0]['keyD']
According to http://docs.python.org/dev/library/plistlib.html , plistlib is available to non-Mac platforms only since 2.6, but
I'm trying to modify the plist file at: /Volumes/MacintoshHD/Users/christian/Library/Application Support/iPhone Simulator/4.3.2/Library/Preferences/com.apple.Accessibility.plist Here's my noob
Is there a better / cleaner / shorter way of getting the same output
I have GPS data stored as as .tcx file. This is a xml file
I'm building a version control module for my network and this is what 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.