First time here? Check out the FAQ!
1

Working around Mac OS X Catalina's restrictions?

This isn't precisely a wing issue, but I'm running into it in wing specifically, so I'm hoping you guys might have an answer. I recently updated my mac OS machine to Catalina (BIG mistake!). Now trying to run commands like os.listdir or anything else that accesses the file system from the wing debugger or built-in shell just gives a "permission denied" error - even though I am just trying to access my files. I have tried adding WingPro.app and wing-internal-python to the "full disk access" section of the security preferences pane, but I still get the issue. Running python through the terminal, on the other hand, works fine after adding terminal to that section. So it seems like I should be able to fix this by adding something to the full disk access section, but I can't figure out what... Any tips/ideas? Thanks.

EDIT: PRECISE steps to recreate this issue:

  1. Add WingPro.app to the full disk access list in the security pane. Make sure it is NOT listed in the "Files and Folders" section
  2. Open WingPro, but DO NOT open or create any documents in Documents, Desktop, etc.
  3. From the python shell, try to run something like os.listdir() on your Documents, Desktop, etc

As an interesting note, this issue is "fixed" the first time WingPro itself tries to access (open or save) a file in any of the affected directories. Once that has happened, even if only once, this problem no longer exists. Even removing Wing from the Full disk access section (with wing not running) does not cause the issue to re-appear. Also, apparently, this problem does not arise if you do not first add Wing to the full disk access section, as in that situation the system properly prompts to allow access (according to comments).

This is clearly an issue with the implementation of the new security features in Catalina, and how they interact with the existing "full disk access" permissions, and not an issue with WingIDE. In any case, now that WingPro has accessed documents in all relevant locations, it is working properly. Thanks for the feedback!

ibrewster's avatar
31
ibrewster
asked 2019-12-27 18:07:11 -0500, updated 2020-01-07 13:15:57 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Does it work to add the Python you are running to the list? You can see where that is with 'print(sys.executable)' after 'import sys'. Catalina does seem to be causing a lot of problems, and I think this may be a new one we've not yet seen.

Wingware Support's avatar Wingware Support (2019-12-27 22:59:12 -0500) edit

Interesting wrinkle. So sys.executable points to python in my virtualenv (well, venv technically), which is a symlink to /Library/Frameworks/Python.framework/Versions/3.6/bin/python3, which is itself a symlink to python3.6 in the same directory - which is not recognized as a executable by the security preferences pane (it is disabled from selection and has a document icon). Looking at it in terminal, and comparing to other things in the same directory that are recognized as executables, the only difference I can see is that the python binary is owned by root, while the ones that are recognized are owned by me...

ibrewster's avatar ibrewster (2019-12-28 10:40:51 -0500) edit

What are the full versions of Wing, Python, and macOS that you're using?

I'm having difficulty reproducing this with Wing 7.1.3.1, Python 3.6.4, and macOS 10.15.2 using os.listdir('/Users/<username>/Documents') as a test after giving Wing permission to use the Documents folder. I also wrote a file in Documents without a problem. I tried Python 3.6.4 just because it's an older version that predates Catalina's release.

Wingware Support's avatar Wingware Support (2019-12-28 19:24:16 -0500) edit

Wing 7.1.3.1, MacOS 10.15.2, python 3.6.5. I think the key here is this line: "...after giving Wing permission to use the Documents folder" How on earth do you do that???? Cause just giving it full disk access doesn't seem to be enough...at least, not for me. Unless that is what you were referring to?

ibrewster's avatar ibrewster (2019-12-28 19:53:08 -0500) edit

Interestingly, running sys.executable from the terminal python (which does work) and from the Wing python shell (which gives the error) can return the exact same result, so it's not the python executable itself that is different. If you remove wing from having permission to use the Documents folder, do you get the PermissionError? If so, there has to be something different about how you are giving wing permission to use the documents folder and how I am...

ibrewster's avatar ibrewster (2019-12-28 20:02:52 -0500) edit
add a comment see more comments

1 Answer

1

I've been using Catalina ofr some time and don't see these issues, which suggests to me they may be specific to your machine. https://forums.developer.apple.com/th... may possibly be relevant.

Steve Holden's avatar
61
Steve Holden
answered 2020-01-04 03:27:32 -0500
edit flag offensive 0 remove flag delete link

Comments

Not precisely specific to my machine, but rather to how I was using wing. I had 1) put wing into the Full Disk access section of system preferences, but 2) not actually tried to access anything in Documents or Desktop from wing itself (just from the code). Once I opened something from each one, the system properly granted access to those directories, and it's been fine ever since. Stupid overly-paranoid security that you can't turn off!

ibrewster's avatar ibrewster (2020-01-04 10:49:10 -0500) edit

It looks like creating a file in my home directory on Catalina from within Wing prompts to allow that access and when I allow it the thing that's added in Security is under Files and Folders and not Full Disk Access. I don't know if that's relevant. In any case, I can confirm that things seem to work with Wing 7.1.2.3 on a clean new Catalina OS install, as of January 6, 2020.

Wingware Support's avatar Wingware Support (2020-01-07 12:53:44 -0500) edit

@wingwareSupport: Most likely yes, that does make a difference. From what I can tell, the only difference between your setup that prompts properly, even when NOT creating or opening a file from wing, but simply trying to access directories from code is that I MANUALLY added Wing.app to full-disk access. I'll play around a bit more, but it seems that if I had NOT done that, then I should have gotten prompted.

ibrewster's avatar ibrewster (2020-01-07 12:57:41 -0500) edit

I think we're seeing quirks (some would call them bugs) in the Catalina privacy protection implementation. Hopefully things like this will be ironed out as Catalina matures.

Wingware Support's avatar Wingware Support (2020-01-07 13:06:51 -0500) edit

It seems that what I did also allowed debug processes access to Home, so it is plausible the Files and Folders settings are inherited by child process but not Full Disk Access and setting Wing Pro into the latter prevented the creation of the former. But I'm just guessing at this point.

Wingware Support's avatar Wingware Support (2020-01-07 13:09:31 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer