OK, so to add documents I had to remove full disc access.
I then tried to access the documents folder from the terminal and was prompted to give permission. I selected to give access, then confirmed it was there in settings/privacy.
Still got the same error.
I then re-applied full disk access - which then take priority over the documents permission (the documents radio button is replaced with a non selectable “full disk access”. So I think is is safe to assume that full disk access grants permissions everywhere - verified by creating a text file in documents using nano.
I am also able to create files in other locations (eg downloads) without issue.
Thanks for taking the time so far - but I don’t think the problem here is with terminal file access permissions.
Thanks for getting back - I’ve fixed it. For the benefit of anyone with similar problems:
I found this thread:
The user there solved the problem by logging out of apple ID and logging back in. I tried that and it didn’t help (wish I hadn’t - now resyncing all my photos )
However, he also diagnosed that solution by creating a new user account and trying there. This I did, and the operation worked in the new user account. I checked permissions there, and found that the app “python” was granted access to documents.
Logged back into my normal account, gave python access to documents, and it now works.
Thanks Barry for your time spent helping me.
(Can I set this to solved other than by adding the word to the title?)