Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Feb 12, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 12, 2024

Bug summary

I am using Mac m3 pro and I keep getting this error message.
Python default interpreter path is "not synced" : /usr/bin/python3

I'm trying to display a black screen (following a tutorial, and the guy who does it doesn't get any error message and everything displays correctly).

Does anyone know how to fix this? Thanks a lot in advance.

Code for reproduction

import pygame
pygame.init()


win = pygame.display.set_mode((500,500))

pygame.display.set_caption("First Game")

Actual outcome

Black Screen is displayed for like 1ms. And I get this message (the one in the title):

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

Expected outcome

Black Screen should be displayed and shouldn't be disappearing unless I click on the close window button.

Additional information

this code:
"""

import pygame
import spritesheets

pygame.init()

SCREEN_WIDTH = 500
SCREEN_HEIGHT = 500

screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Spritesheets')

sprite_sheet_image = pygame.image.load('doux.png').convert_alpha()
sprite_sheet = spritesheets.SpriteSheet(sprite_sheet_image)

BG = (50, 50, 50)
BLACK = (0, 0, 0)

frame_0 = sprite_sheet.get_image(0, 24, 24, 3, BLACK)
frame_1 = sprite_sheet.get_image(1, 24, 24, 3, BLACK)
frame_2 = sprite_sheet.get_image(2, 24, 24, 3, BLACK)
frame_3 = sprite_sheet.get_image(3, 24, 24, 3, BLACK)

run = True
while run:

#update background
screen.fill(BG)

#show frame image
screen.blit(frame_0, (0, 0))
screen.blit(frame_1, (72, 0))
screen.blit(frame_2, (150, 0))
screen.blit(frame_3, (250, 0))

#event handler
for event in pygame.event.get():
	if event.type == pygame.QUIT:
		run = False

pygame.display.update()

pygame.quit()

"""

displays something but also gives me an error message:
Python[3099:72313] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

Operating system

OS/X

Matplotlib Version

3.8.2

Matplotlib Backend

No response

Python version

3.12.2

Jupyter version

No response

Installation

pip

@ghost ghost closed this as completed Feb 12, 2024
@ghost
Copy link
Author

ghost commented Feb 12, 2024

figured it out lol mb

@tacaswell
Copy link
Member

Duplicate of #27389

@tacaswell tacaswell marked this as a duplicate of #27389 Feb 12, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant