mcxToProfile
mcxToProfile copied to clipboard
Why use FoundationPlist instead of plistlib?
The Foundation module necessitates installation of macadmins python3 which would require an Xcode.app installation which would require an iCloud account sign-in which I'd prefer to not use. What is the reason for not using the built-in plistlib module?
At the time this was written, plistlib didn't work with binary plists.. so likely why.
But if you check the imports, the issue here isn't FoundationPlist, but the Python-ObjectiveC items.
And the bridge for them has been broken in Apple's Python3 for some time:
$ which python3 /usr/local/bin/python3 $ python3 Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import Foundation Traceback (most recent call last): File "
", line 1, in ModuleNotFoundError: No module named 'Foundation'
So essentially this could be re-written using plistlib? There isn't any added benefit of using Foundation or a PyObjC bridge if plistlib now handles the binary conversion automatically?