subprocess.call() failed with error -43 After Catalina update

Viewed 236

I had a piece of code to launch the messages app in a python script which worked for years, but it inexplicably started failing after the update to macOS Catalina 10.15

I was using the subprocess API to run a bash command

subprocess.call(
    ["/usr/bin/open", "-a", "/Applications/messages.app"])

Previously, this worked fine but now I get the error FSPathMakeRef(/Applications/messages.app) failed with error -43.

2 Answers

I was able to solve my problem by using os instead of subprocess.

import os
#...
os.system("open -a messages")

Though I'm still not really sure why it stoped working to begin with.

The message app is moved to /System/Applications/

$open "/System/Applications/Messages.app"

Catalina has moved some files to a dedicated volume but in Finder they remained at the same place, as documented here

macOS Catalina runs on a dedicated, read-only system volume called Macintosh HD. This volume is completely separate from all other data to help prevent the accidental overwriting of critical operating system files. Your files and data are stored in another volume named Macintosh HD - Data. In the Finder, both volumes appear as Macintosh HD.

Related