Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cython dump method #239

Closed
wants to merge 1 commit into from
Closed

Fix Cython dump method #239

wants to merge 1 commit into from

Conversation

dnicolson
Copy link
Contributor

@dnicolson dnicolson commented Nov 24, 2023

This fixes the dump method by accepting plist objects and using the correct data type for XML files.

This code now works:

import plist

test = plist.loads(b'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array>\t<string>one</string></array></plist>')

with open('test-plist-xml.plist', 'wb') as fp:
  plist.dump(test, fp)

with open('test-plist-binary.plist', 'wb') as fp:
  plist.dump(test, fp, fmt=2)

with open('test-list-xml.plist', 'wb') as fp:
  plist.dump([1,2,3], fp)

@nikias
Copy link
Member

nikias commented Nov 26, 2023

Merged with d1d2d36.

@nikias nikias closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants