I am attempting to execute this command from a Python script:
sed -i s/"exited_cleanly":false/"exited_cleanly":true/ ~/.config/chromium/Default/Preferences
When I run from the bash console, it succeeds.
But when I run with the following code, it does not:
process = subprocess.Popen(['sed', '-i', 's/"exited_cleanly":false/"exited_cleanly":true/', '~/.config/chromium/Default/Preferences'], stdout=subprocess.PIPE)
process.communicate()
>>> sed: can't read ~/.config/chromium/Default/Preferences: No such file or directory
But this file clearly exists, I can find it, etc.
What's the issue? Am I missing something?
I'm on Python 3.9
Thanks!
Eduardo