mirror of
https://github.com/munki/munki.git
synced 2026-01-07 06:59:57 -06:00
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:
@@ -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_(
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user