godot-python icon indicating copy to clipboard operation
godot-python copied to clipboard

Autoloading GDScripts makes a project crash after playing it.

Open bloodmoon0720 opened this issue 5 years ago • 4 comments
trafficstars

First of all, thank you for your effort in trying to add this beautiful language to the Godot Engine.

Whenever I try to run a project that Autoloads GDScripts, the game crashes shortly after showing Godot Splash Screen with raising the following errors:

Pythonscript 0.40.0 (CPython 3.8.3.final.0) AttributeError: module 'godot' has no attribute 'globals' Exception ignored in: '_godot.pythonscript_add_global_constant' AttributeError: module 'godot' has no attribute 'globals'

extends Node


var spam = "spam"  # Debugging Variable

Autoloading PythonScripts seemingly works fine, but only after spitting out similar errors:

Pythonscript 0.40.0 (CPython 3.8.3.final.0) AttributeError: module 'godot' has no attribute 'globals' Exception ignored in: '_godot.pythonscript_add_global_constant' AttributeError: module 'godot' has no attribute 'globals' Calling wrapper on <class 'autoload.Autoload'> AttributeError: module 'godot' has no attribute 'globals' Exception ignored in: '_godot.pythonscript_add_global_constant' AttributeError: module 'godot' has no attribute 'globals' spam

from godot import exposed, export
from godot import *


@exposed
class Autoload(Node):
    spam = "spam"  # Debugging Variable

Is this a bug? Or did I set up something wrong?

I am using Godot v3.2.2 (stable, win64) on Windows 10. I am (apparently) using PythonScript 0.40.0 (CPython 3.8.3.final.0), which I downloaded from Godot AssetLib. I hope you find the info above helpful.

bloodmoon0720 avatar Jul 29 '20 13:07 bloodmoon0720

It is a bug in godot-python. I have fixed it but it's not released yet, building from master should work.

matheus2740 avatar Aug 02 '20 17:08 matheus2740

@matheus2740, I got same error when importing a GDScript singletone. Please, tell me here when you release a version without this bug.

HalfL1fe3 avatar Oct 23 '20 11:10 HalfL1fe3

@HalfL1fe3 I believe @touilleMan has also improved globals some more in the recent months, so building from master should solve the issue until a new release is not out.

matheus2740 avatar Oct 23 '20 18:10 matheus2740

@matheus2740 Also facing this bug. If the master fix the issue, a release may be a good idea

lucblender avatar Nov 03 '20 10:11 lucblender