The Rhino Script Editor IDE unexpectedly executes Python code while editing.
If a variable is named imported_data
and you type a "."
(dot), the IDE executes a previously imported module
Steps to Reproduce:
- Create a file with the following code, e.g.:
# testrun.py
import rhinoscriptsyntax as rs
def testprint():
line_1 = "THIS IS STRANGE"
line_2 = "UNUSUAL"
line_3 = "BEHAVIOR"
message_text = line_1 + "\n" + line_2 + "\n" + line_3
rs.MessageBox(message_text)
- Save this file as “testrun.py”.
- Create a new file and save as e.g. “test2.py”.
- Insert the following code:
# test2.py
import testrun
from importlib import reload
reload(testrun)
imported_data = testrun.testprint()
- Execute this code.
- Try adding a dot (
.
) afterimported_data
on a new line.
Expected Behavior:
- Nothing, just the dot.
Actual Behavior:
- The IDE executes the function (
testrun.testprint()
)
3 posts - 2 participants