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.

Author shields-fn
Recipients shields-fn
Date 2020-06-22.22:42:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592865765.42.0.949299240899.issue41083@roundup.psfhosted.org>
In-reply-to
Content
On macOS 10.5.5:

/tmp $ defaults export com.apple.security.KCN -
<?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>absentCircleWithNoReason</key>
        <false/>
        <key>applicationDate</key>
        <date>0000-12-30T00:00:00Z</date>
        <key>lastCircleStatus</key>
        <integer>-1</integer>
        <key>lastWritten</key>
        <date>2019-10-15T17:23:33Z</date>
        <key>pendingApplicationReminder</key>
        <date>4001-01-01T00:00:00Z</date>
        <key>pendingApplicationReminderInterval</key>
        <integer>86400</integer>
</dict>
</plist>
/tmp $ cat plist_date_reduction.py 
#!/usr/bin/env python3

import plistlib
import subprocess

if __name__ == "__main__":
    plist = subprocess.check_output(["defaults", "export", "com.apple.security.KCN", "-"])
    print(plistlib.loads(plist, fmt=plistlib.FMT_XML))
/tmp $ python3.8 plist_date_reduction.py 
Traceback (most recent call last):
  File "plist_date_reduction.py", line 8, in <module>
    print(plistlib.loads(plist, fmt=plistlib.FMT_XML))
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 1000, in loads
    return load(
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 992, in load
    return p.parse(fp)
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 288, in parse
    self.parser.ParseFile(fileobj)
  File "/private/tmp/python@3.8-20200527-50093-16hak5w/Python-3.8.3/Modules/pyexpat.c", line 461, in EndElement
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 300, in handle_end_element
    handler()
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 376, in end_date
    self.add_object(_date_from_string(self.get_data()))
  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/plistlib.py", line 254, in _date_from_string
    return datetime.datetime(*lst)
ValueError: year 0 is out of range
History
Date User Action Args
2020-06-22 22:42:45shields-fnsetrecipients: + shields-fn
2020-06-22 22:42:45shields-fnsetmessageid: <1592865765.42.0.949299240899.issue41083@roundup.psfhosted.org>
2020-06-22 22:42:45shields-fnlinkissue41083 messages
2020-06-22 22:42:45shields-fncreate