summaryrefslogtreecommitdiffstats
path: root/Lib/plistlib.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2020-10-20 07:26:33 (GMT)
committerGitHub <noreply@github.com>2020-10-20 07:26:33 (GMT)
commit3185267400be853404f22a1e06bb9fe1210735c7 (patch)
treec3f3df6b68c8c2e54a83b05af2fb41efaa81fa94 /Lib/plistlib.py
parent109826c8508dd02e06ae0f1784f1d202495a8680 (diff)
downloadcpython-3185267400be853404f22a1e06bb9fe1210735c7.zip
cpython-3185267400be853404f22a1e06bb9fe1210735c7.tar.gz
cpython-3185267400be853404f22a1e06bb9fe1210735c7.tar.bz2
bpo-41491: plistlib: accept hexadecimal integer values in xml plist files (GH-22764)
Diffstat (limited to 'Lib/plistlib.py')
-rw-r--r--Lib/plistlib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index ba7ac19..a740351 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -252,7 +252,11 @@ class _PlistParser:
self.add_object(False)
def end_integer(self):
- self.add_object(int(self.get_data()))
+ raw = self.get_data()
+ if raw.startswith('0x') or raw.startswith('0X'):
+ self.add_object(int(raw, 16))
+ else:
+ self.add_object(int(raw))
def end_real(self):
self.add_object(float(self.get_data()))