You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Python docstrings containing an apostrophe end up in a weird state, continuing the docstring parsing beyond the end of the docstring and then ending up in a string state waiting for a closing single quote / apostrophe.
To Reproduce
#!/usr/bin/env python3"""Docstrings containing an apostrophe (') are handled incorrectlyThe line above is counted as code despite being in the middle of a docstring.The end of docstring flag seems to be changed to an apostrophe,which means the next line will not exit the docstring."""# Code containing single quotes will exit the docstring,# but presuming the quotes are balanced the second# quote will put us in string scanning mode.if__name__=='__main__':
print('Hello, World!')
# Not counted as a comment# ^ Not counted as a blank line# Break out of string scanner with unbalanced single quote: 'exit(0)
Expected behavior
Apostrophes / single quotes inside a docstring don't interrupt docstring parsing.
Desktop (please complete the following information):
Version 3.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Python docstrings containing an apostrophe end up in a weird state, continuing the docstring parsing beyond the end of the docstring and then ending up in a string state waiting for a closing single quote / apostrophe.
To Reproduce
Expected behavior
Apostrophes / single quotes inside a docstring don't interrupt docstring parsing.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: