coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
789 stars 138 forks source link

Mac OS Operation not permitted #167

Closed Philomath88 closed 5 months ago

Philomath88 commented 9 months ago

Environment:

Description: When trying to initialize the myfitnesspal.Client(), I'm encountering a PermissionError related to accessing Safari's Cookies.binarycookies file.

Steps to Reproduce:

  1. Initialize myfitnesspal.Client() using the following code:

import myfitnesspal

client = myfitnesspal.Client()
Running the script even with sudo permissions results in the error.
Error Log:

mathematica
PermissionError: [Errno 1] Operation not permitted: '/Users/[USERNAME]/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies'
Additional Information:

The file permissions seem to be set correctly.
Even when running the Python script with sudo, the error persists.
I was prompted for my macOS password (likely for Keychain access) twice before the error message was displayed.
Any assistance or guidance on resolving this issue would be greatly appreciated.
Philomath88 commented 9 months ago

Update

I tried this suggestion and it worked: https://github.com/coddingtonbear/python-myfitnesspal/issues/148

not sure if it is a Safari Problem or if I had to import browser_cookie3