targendaz2 / Mac-Set-Default-Apps

A utility to change default applications in macOS
MIT License
85 stars 10 forks source link

Script fails with Python 3 #10

Closed IT-Yogi closed 2 years ago

IT-Yogi commented 2 years ago

Hi David,

I really appreciate your script but got some issues with MacOS 12.3.1 and installed Python 3.10.4 from https://www.python.org/downloads/macos/. I'm using the deployment via Jamf Script but it seems like python 3 isn't found because your script is poiting at /usr/bin/python which doesn't exists with python 3.10.4. I changed it to /usr/bin/python3 but this also fails. Did I miss something ?

/usr/bin/python Script result: sh: /Library/Application Support/JAMF/tmp/Mac Set Default Apps (MSDA): /usr/bin/python: bad interpreter: No such file or directory

/usr/bin/python3 Script result: Traceback (most recent call last): File "/Library/Application Support/JAMF/tmp/Mac Set Default Apps (MSDA)", line 471, in <module> sudo_command = '/usr/bin/sudo -u ' + username TypeError: can only concatenate str (not "bytes") to str

Cheers, Jonny

targendaz2 commented 2 years ago

Python no longer comes preinstalled on macOS. You'll need to install python3 before you can use MSDA on a Mac.

IT-Yogi commented 2 years ago

Hi David,

Yes as I mentioned I installed python3 3.10.4 before executing your script, but it still fails?

targendaz2 commented 2 years ago

Sorry, my bad. The script isn't python3 compatible. You'd need to install python2, although it's reached EOL.

IT-Yogi commented 2 years ago

Oh ok. I understand. Any chances for an update for python3?

targendaz2 commented 2 years ago

I'll either update it to zsh or swift. Probably not python3.