mcxToProfile icon indicating copy to clipboard operation
mcxToProfile copied to clipboard

Why use FoundationPlist instead of plistlib?

Open cspence001 opened this issue 2 years ago • 2 comments

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?

cspence001 avatar Jan 25 '23 20:01 cspence001

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'

macmule avatar Jan 26 '23 09:01 macmule

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?

cspence001 avatar Jan 26 '23 23:01 cspence001