BGE logic: Debug mode for Python module controllers forbids script renaming
Open, NormalPublic


System Information
Linux Mint 64b
Geforce GT650M

Blender Version
Broken: from 2.76 official to 2.79 - latest build

Short description of error
Debug mode for controllers has a bug...
Module reloading in Python controller debug mode fails if the script file has been renamed between two BGE executions.

Exact steps for others to reproduce the error

  1. download and open the attached .blend file
  2. rename the script from "test1" to any other name, for example "test2", both in the Text Editor and the Controller in the Logic Bricks
  3. start the game; it will instantaneously quit as requested by the script
  4. rename the script again to some other name
  5. restart the game; this time it won't quit and instead send the following error (up to the Blender version) to stderr:
Python module can't be reloaded - object 'Cube', controller 'Python':
Traceback (most recent call last):
  File "/home/Programmes/blender-2.76b/2.76/python/lib/python3.4/", line 315, in reload
    return importlib.reload(module)
  File "/home/Programmes/blender-2.76b/2.76/python/lib/python3.4/importlib/", line 149, in reload
  File "<frozen importlib._bootstrap>", line 1134, in exec
AttributeError: 'NoneType' object has no attribute 'name'

Thus it looks like some script caching problem.




This occurs with bge internal or blenderplayer?
If it is bge internal, have you save the blend file after file name modifications?


It happens in BGE internal only.
Saving the file after modification does not help; only closing Blender seems to solve the problem.

Joey Ferwerda (TheOnlyJoey) claimed this task.

As this is not a regression, this is not priority to fix at the moment.
For BGE fixes i would recommend submitting to UPBGE

Please, don't archive/close the bugs. If the bug it is not a regression you can put under "normal" label.

NOTE: In the UPBGE issue list we have only UPBGE specific bugs. For normal BGE bugs is the right procedure.
Jorge Bernal (lordloki) reopened this task as Open.Feb 2 2017, 8:00 PM
Jorge Bernal (lordloki) triaged this task as Normal priority.