We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@bcolsen
I think this was introduced in PR #7310. I was not able to reproduce the error when checking out to 29e0623.
# -*- coding: utf-8 -*- #%% dirname = ("C:\\Users\\User\\test.py") # %%
Ctrl + Enter
Shift + Enter
dirname should be defined in the current console, but an error is raised instead.
dirname
runcell('','C:/Users/User/Desktop/test.py') File "<ipython-input-26-0a3ec57e3b80>", line 4 dirname = ("C:\Users\User\test.py") ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
pygments >=2.0 : 2.2.0 (OK) sphinx >=0.6.6 : 1.8.1 (OK) pyls >=0.19.0 : 0.19.0 (OK) nbconvert >=4.0 : 5.3.1 (OK) pandas >=0.13.1 : 0.23.4 (OK) numpy >=1.7 : 1.15.2 (OK) sympy >=0.7.3 : None (NOK) cython >=0.21 : None (NOK) qtconsole >=4.2.0 : 4.5.0.dev0 (OK) IPython >=4.0 : 7.0.1 (OK) matplotlib >=2.0.0: None (NOK) pylint >=0.25 : 2.1.1 (OK)
The text was updated successfully, but these errors were encountered:
@bcolsen, could you take a look at this one? Thanks!
Sorry, something went wrong.
It looks like the escape /'s are being remove before running the cell.
/
I get the same error running:
In [112]: dirname = ('C:\Users\User\test.py') File "<ipython-input-112-09e9a480868a>", line 1 dirname = ('C:\Users\User\test.py') ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I can test this tonight but I think a 'r"""{}"""') on this line might work:
'r"""{}"""')
spyder/spyder/plugins/ipythonconsole/plugin.py
Line 939 in 4733c44
Yep, I was thinking an r would help to solve this.
r
Cool, thank you very much for taking care of this! This is a little bit annoying hehe
I actually ran into this one myself this afternoon with a \n :-)
\n
bcolsen
Successfully merging a pull request may close this issue.
Issue Report Checklist
Problem Description
@bcolsen
I think this was introduced in PR #7310. I was not able to reproduce the error when checking out to 29e0623.
What steps reproduce the problem?
Ctrl + Enter
orShift + Enter
).What is the expected output? What do you see instead?
dirname
should be defined in the current console, but an error is raised instead.Paste Traceback/Error Below (if applicable)
Versions
Dependencies
The text was updated successfully, but these errors were encountered: