Warning message on Terminal for macOS Sonoma14.1 - What does this mean and how can I, and *should I*, bypass this?

26 Views Asked by At

I am a beginner Coming across a warning message that reads as follows:

WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

For context, I am trying to create a facial recognition app locally that allows a picture to be taken as a face is detected on the screen. ChatGPT is holding my hand through this because I am relatively new to programming. So the code I ran on the terminal was generated by ChatGPT. I ran it in a virtual environment within the directory that the program and script is in. This was just to test if the OpenCV library that I installed works on the machine.

Sequence of Events: Wrote & saved script, opened terminal, navigated to local directory on terminal (cd /user/blah blah), activated virtual env (source facrecogenv/bin/activate), navigated to scripts directory (cd scripts), ran the test script for OpenCV (python test_opencv.py), test capture window opens, terminal outputs the Warning message above

For further information I shall add the code that was within the script that I ran alongside any screenshots that I thought were neccessary:

The Code within the script that I ran:

import cv2

def test_capture():
    cap = cv2.VideoCapture(0)

    ret, frame = cap.read()
    if ret:
        cv2.imshow("Test Capture", frame)
        cv2.waitKey(0)
        cv2.destroyAllWindows()
    else:
        print("Failed to capture image")

    cap.release()

if __name__ == "__main__":
    test_capture()

How the script looks in vsCode

The GPT4 generation

I am a beginner I am very new to projects like this. In fact, I am very new to actually interacting and asking questions on stack overflow - I hope I get an answer to this swiftly because I could not find the exact answers (even if I may have, I did not understand it enough) nor did I find a situation quite as similar to mine.

I tried to play around with it and see how I can make it work. I entered "YES" into the terminal hoping it just needed a confirmation or something but there was no response. Then when I closed the test capture window the terminal started printing "y"s seemingly infinitely. (as shown in screenshot 1.a. below) It seems like it kept returning the "y" character if I didn't do anything else so I tried to close the terminal to stop it from printing infinite "y"s and it displayed a message that reads (attached in screenshot 1.b. below) and then when I open the terminal again it looks normal (I am assuming the virtual environment deactivated upon closing the terminal so the whole terminal and regular processes do not have anything going wrong with them)

Another thing to note is that when I click onto the test capture window that pops up and then I press "0" like the script says - the window closes. I suppose that confirms the script is working. The camera seems to be active too although the test capture window does not display any image of it. (as shown in screenshot 1.a. below).

screenshot 1.a.

screenshot 1.b.

I hope this was a thorough enough explanation, please be encouraging if you can - I'm trying my best here :) thank you so much!

0

There are 0 best solutions below