Skip to content
New issue

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

Fix crash for non breaking spaces in docstring #2099

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/data/comments_non_breaking_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
# DEFAULT_TYPE_ATTRIBUTES,
)

result = 1 # A simple comment
result = ( 1, ) # Another one
result = 1 # A simple comment with a NBSP
result = ( 1, ) # Another NBSP

result = 1 # type: ignore
result = 1# This comment is talking about type: ignore
result = 1# This comment is talking about type: ignore and start with NBSP
square = Square(4) # type: Optional[Square]

def function(a:int=42):
""" This docstring is already formatted
a
b
""" This docstring start with a NBSP
  There is one NBSP column 5 here
       This is 7 NBSP
"""

#  There's a NBSP + 3 spaces before
# And 4 spaces on the next line
pass
Expand Down