This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: plistlib: output empty elements correctly
Type: behavior Stage: resolved
Components: Library (Lib), macOS Versions: Python 3.2, Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: hynek, ned.deily, python-dev, ronaldoussoren, ssm
Priority: normal Keywords: patch

Created on 2012-05-16 22:17 by ssm, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
plistlib_empty_objects.patch ssm, 2012-05-16 22:17 Patch to plistlib review
plistlib_empty_element_test.patch ssm, 2012-05-27 17:40 Regression test review
Messages (9)
msg160934 - (view) Author: Sidney San Martín (ssm) * Date: 2012-05-16 22:17
plistlib’s output is currently byte-for-byte identical to Apple’s, except arrays and dictionaries are stored with self-closing tags (e.g. '<array/>') and plistlib outputs empty tags with a newline (e.g. '<array>\n</array>').

This tiny patch makes its output for empty arrays and dictionaries consistent with the OS’s.
msg161562 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2012-05-25 10:24
Sidney, would you mind adding a regression test for both cases?

Ned, Ronald what's your take on this?
msg161563 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2012-05-25 10:29
The patch looks fine, but as you noticed there should be a test case for this.

I'm -1 w.r.t. applying this to 3.2 or 2.7, it is a functional change that isn't a bug (Apple's libraries will happily read empty arrays that are written as <array></array>).
msg161564 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2012-05-25 10:33
Sidney: Would you be willing to sign the contributor agreement? The following page contains more information on the agreement:
msg161713 - (view) Author: Sidney San Martín (ssm) * Date: 2012-05-27 17:40
Hynek: Here you go!

Ronald: Emailed it in on Friday.
msg161859 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2012-05-29 07:59
The patch LGTM, but Pam seemed to have problems to find your account ( – did you get the reply and followed up on that?
msg161863 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-29 10:08
New changeset 9e64084f9980 by Hynek Schlawack in branch 'default':
#14835: Make plistlib output empty arrays & dicts like OS X
msg161864 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2012-05-29 10:10
Thank you for your contribution!

But please help Pam to work out your contribution form.
msg161894 - (view) Author: Sidney San Martín (ssm) * Date: 2012-05-29 15:37
Thanks Hynek, awesome! It looks like it’s in now.
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 59040
2012-05-29 15:37:32ssmsetmessages: + msg161894
2012-05-29 10:10:26hyneksetstatus: open -> closed
resolution: fixed
messages: + msg161864

stage: patch review -> resolved
2012-05-29 10:08:16python-devsetnosy: + python-dev
messages: + msg161863
2012-05-29 07:59:46hyneksetmessages: + msg161859
2012-05-27 17:40:16ssmsetfiles: + plistlib_empty_element_test.patch

messages: + msg161713
2012-05-25 10:33:48ronaldoussorensetmessages: + msg161564
2012-05-25 10:29:00ronaldoussorensetmessages: + msg161563
2012-05-25 10:24:23hyneksetmessages: + msg161562
2012-05-17 09:43:22hyneksetnosy: + ned.deily
2012-05-17 09:41:45hyneksetnosy: + hynek
stage: patch review

versions: - Python 3.1, Python 3.4
2012-05-16 22:17:23ssmcreate