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 crashes on docstring whitespace changes #1417

Merged
merged 1 commit into from
May 16, 2020

Conversation

JelleZijlstra
Copy link
Collaborator

Fixes #1415

Comment on lines +146 to +150


def single_line():
"""But with a newline after it!"""
pass

This comment was marked as resolved.

Copy link
Collaborator

@ichard26 ichard26 May 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, didn't see the output comment. Sorry about the unnecessary notifications.

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@cooperlees cooperlees merged commit c7da348 into psf:master May 16, 2020
alexmv added a commit to alexmv/black that referenced this pull request May 22, 2020
The PEP 257 algorithm used in psf#1053 results in trimming trailing
whitespace in docstrings -- see psf#1415 and fixes in psf#1417.  Removing
trailing whitespace may result in four quotes in a row:

   def foo():
       """"Some content
       and more "here" """
       pass

When closing the docstring, escape any trailing quote characters that
it matches, if they are not already escaped.

Fixes psf#1446.
alexmv added a commit to alexmv/black that referenced this pull request May 22, 2020
The PEP 257 algorithm used in psf#1053 results in trimming trailing
whitespace in docstrings -- see psf#1415 and fixes in psf#1417.  Removing
trailing whitespace may result in four quotes in a row:

    def foo():
        """"Some content
        and more "here" """
        pass

When closing the docstring, escape any trailing quote characters that
it matches, if they are not already escaped.

Fixes psf#1446.
alexmv added a commit to alexmv/black that referenced this pull request May 22, 2020
0;95;0c
The PEP 257 algorithm used in psf#1053 results in trimming trailing
whitespace in docstrings -- see psf#1415 and fixes in psf#1417.  Removing
trailing whitespace may result in four quotes in a row:

    def foo():
        """"Some content
        and more "here" """
        pass

When closing the docstring, escape any trailing quote characters that
it matches, if they are not already escaped.

Fixes psf#1452.
alexmv added a commit to alexmv/black that referenced this pull request May 22, 2020
The PEP 257 algorithm used in psf#1053 results in trimming trailing
whitespace in docstrings -- see psf#1415 and fixes in psf#1417.  Removing
trailing whitespace may result in four quotes in a row:

    def foo():
        """"Some content
        and more "here" """
        pass

When closing the docstring, escape any trailing quote characters that
it matches, if they are not already escaped.

Fixes psf#1452.
alexmv added a commit to alexmv/black that referenced this pull request Jul 31, 2020
The PEP 257 algorithm used in psf#1053 results in trimming trailing
whitespace in docstrings -- see psf#1415.

Adjust the algorithm to preserve leading and trailing whitespace; this
reverts the changes in psf#1417.  This diverges from PEP 257, but better
retains the contents of the docstring.

Fixes psf#1452 because we no longer can end up with four trailing quotes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on docstring ending with newlines
3 participants