ID 231675 - console_print() in a shelf script should print to Python Console if it exists, but always prints to the terminal/command prompt instead

Follow

Problem summary
According to the comments when creating a new shelf script, console_print() should do the following:
 
# console_print(message, raisePanel = False):
#              If the Python Console exists, print the message to it.
#              Otherwise, print the message to the shell. If raisePanel
#              is passed as True, the panel will be raised to the front.
 
However, it seems to always print to the terminal.
 
Steps to reproduce
 
1) Go to the Shelf Actions icon near the Help menu and select Add > New Shelf..
 
2) Enter a name in the Shelf Properties and hit OK.
 
3) Go to Shelf Actions again and use Add -> New Item... 
 
4) Fill in the Name which by default will be Button, and hit OK. The script gets created automatically after this step and gets opened in your default text editor.
 
5) Add the line 

console_print("Hello World!")
at the end of the script.
 
6) Now run the script by going into the user shelf and clicking on the script name. Both print statements will be printed to the terminal/command prompt instead of the Python Console, even if it exists.

Reproduced by Support
Reproduced in 2.0v1, 2.0v5, 2.1v1, 1.1v4, 2.5v1, 2.5v2
 
Expected behaviour
Messages printed using console_print() should be printed to an existing Python Console
 
Actual behaviour
All messages are printed to the shell

    We're sorry to hear that

    Please tell us why