libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
537 stars 304 forks source link

Fix dictionary key deletion in Cython #240

Closed dnicolson closed 10 months ago

dnicolson commented 10 months ago

This fixes the following error:

TypeError: expected bytes, str found

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"><dict><key>k</key><string>v</string><key>k2</key><string>v2</string></dict></plist>')
del test['k']
nikias commented 10 months ago

Merged with 960da293e95883000e2d71acc8d370eb3e68ba11.