Unrecognized characters caused by middle

Problem Description

Noticed when writing code using notebook with default settings
When entering parentheses for a function’(‘&’)’
I found that the code automatically added two spaces at the end


Running the program will result in an error
image


The error message is as follows

  Cell In[22], line 1
    import matplotlib.pyplot as plt
                                   ^
SyntaxError: invalid non-printable character U+00A0

Finding

After testing the characters, it was found that symbols that need to be entered by holding down shift (such as * { } ") will add two spaces after the symbol when inputting. In contrast, symbols that are input directly by pressing keys (such as [ ] = ), this problem will not occur when typing

Is there a problem with the settings?

The screenshot is very confusing here, the code in the output error does not correspond to the code in the cell input box.

  1. What browser and version of Notebook are you using?
  2. Can you try in another browser and in the latest version of JupyterLab?

I encount the same problems
Have you solved it?


When I use Edge, I get this error。When I use firefox,it’s OK.

1 Like