When getting available license seats in Python 3, make sure data passed to FoundationPlist.readPlistFromString is a byte array. Addresses #957.

This commit is contained in:
Greg Neagle
2019-11-03 22:44:08 -08:00
parent 8065ab94c3
commit e20a7c7e63
2 changed files with 3 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ def writePlist(dataObject, filepath):
def writePlistToString(rootObject):
'''Return 'rootObject' as a plist-formatted string.'''
'''Return 'rootObject' as a plist-formatted (byte)string.'''
plistData, error = (
NSPropertyListSerialization.
dataFromPropertyList_format_errorDescription_(

View File

@@ -72,7 +72,8 @@ def update_available_license_seats(installinfo):
try:
license_data = fetch.getDataFromURL(url)
display.display_debug1('Got: %s', license_data)
license_dict = FoundationPlist.readPlistFromString(license_data)
license_dict = FoundationPlist.readPlistFromString(
license_data.encode("UTF-8"))
except fetch.Error as err:
# problem fetching from URL
display.display_error('Error from %s: %s', url, err)