ID 604481 - Unable to load a toolsets with nuke.loadToolset() from a Python drop handler callback in Nuke.

Follow

Problem summary
Unable to load a toolsets with nuke.loadToolset() or nuke.nodePaste() from a Python drop handler callback in Nuke.
 
Customer reported version
Nuke 14.1v7
 
Customer reported platform
Rocky 9
 
Steps to reproduce
*prerequisite - have a .nk script available
1) In Nuke, open the Script Editor and run the following command:
def drop_test(mime_type, text):     path_to_file = "path/to/script.nk" #change to current file     nuke.loadToolset(path_to_file)     return False nukescripts.addDropDataCallback(drop_test)
2) Observe the error given.
 
Expected behavior
The drop handler calls nuke.loadToolSet() or nuke.nodePaste() and the file gets loaded inside the current nUke script.
 
Actual behavior
The dropper throws an error message for "unknown command" and displays in the Script Editor as: 
RuntimeError The above exception was the direct cause of the following exception: Traceback (most recent call last):   File "<string>", line 1, in <module>   File "C:\Program Files/Nuke16.0v4/plugins\nukescripts\drop.py", line 14, in dropData     if callback(mimeType, text) == True:        ^^^^^^^^^^^^^^^^^^^^^^^^   File "<string>", line 3, in drop_test SystemError: <built-in function loadToolset> returned a result with an exception set
 
Workaround
Using nuke.nodePaste() outside of the dropper function works as expected.
 
Reproduced by Support in:
Nuke 16.0v4 - Windows 10/11, Rocky 9
Nuke 14.0v1 - Wndows 10/11, Rocky 9
 
Earliest version tested
Nuke 14.0v1 - This issue appears to be in all tested versions of the product

    We're sorry to hear that

    Please tell us why