Skip to content

Commit

Permalink
Merge pull request #40 from ActiveState/BE-3614-CVE-2022-48565
Browse files Browse the repository at this point in the history
BE-3614-Adjust cherry-pick for Python2
  • Loading branch information
rickprice authored Mar 14, 2024
2 parents b4803dd + d8d3f10 commit 24790e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Lib/plistlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,8 @@ def end_data(self):
self.addObject(Data.fromBase64(self.getData()))
def end_date(self):
self.addObject(_dateFromString(self.getData()))


class InvalidFileException (ValueError):
def __init__(self, message="Invalid file"):
ValueError.__init__(self, message)
4 changes: 2 additions & 2 deletions Lib/test/test_plistlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ def test_nondictroot(self):
self.assertEqual(test2, result2)

def test_xml_plist_with_entity_decl(self):
with self.assertRaisesRegex(plistlib.InvalidFileException,
with self.assertRaisesRegexp(plistlib.InvalidFileException,
"XML entity declarations are not supported"):
plistlib.loads(XML_PLIST_WITH_ENTITY, fmt=plistlib.FMT_XML)
plistlib.readPlistFromString(XML_PLIST_WITH_ENTITY)

def test_main():
test_support.run_unittest(TestPlistlib)
Expand Down

0 comments on commit 24790e1

Please sign in to comment.