question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python Interactive: Exception won't print message inside angle brackets

See original GitHub issue

Raising an exception in the Python Interactive Window with a message that contains angle brackets <> will remove the text within the angle brackets (and the brackets themselves) from the message, provided the text begins with an alphabetic character. This doesn’t happen with print statements or if the text inside the brackets begins with a non-alphabetic character. If no closing bracket exists in the message, the rest of the message will be removed.

image

Environment data

  • VS Code version: 1.37.1
  • Extension version (available under the Extensions sidebar): 2019.8.30787
  • OS and version: Windows 10 Enterprise 1809
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: N/A
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): Jedi

Expected behaviour

The entire message should be printed when an Exception is raised.

Actual behaviour

The text within the angle brackets is removed.

Steps to reproduce:

  1. Open a Python Interactive window and run the command raise Exception("abc<def>ghi")

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

N/A

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

N/A

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bloiscommented, Sep 4, 2019
raise Exception('<marquee>ERROR ERROR ERROR</marquee>')

😃

1reaction
IanMatthewHuffcommented, Sep 4, 2019

@oliverhiggs. Thanks for the report and the detailed repro. I can confirm what you are seeing, and that it does display correctly in Jupyter. We’ll look into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Interactive: Exception won't print message inside angle ...
The entire message should be printed when an Exception is raised. Actual behaviour. The text within the angle brackets is removed. Steps to ......
Read more >
Printing without parentheses varying error message using ...
I think this error message is produced in some simple cases only as help for the user. def x(): print max (single line)...
Read more >
8. Errors and Exceptions — Python 3.11.1 documentation
The last line of the error message indicates what happened. Exceptions come in different types, and the type is printed as part of...
Read more >
IPython reference
IPython is meant to work as a drop-in replacement for the standard interactive interpreter. As such, any code which is valid python should...
Read more >
PySimpleGUI
PySimpleGUI User's Manual. Python GUI For Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces. The Call Reference ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found