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

INTERNAL ERROR when formatting a function with a comment over max line length #2124

Closed
inftydev opened this issue Apr 22, 2021 · 1 comment
Closed
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working

Comments

@inftydev
Copy link

Describe the bug
Black produced different code when formatting a function with a comment over max line length.

To Reproduce

  1. Take this code
def foo():
    context.this_is_here_so_we_get_a_line_that_is_too_long = Bar(  # and now it is too long
        some=argument
    )
  1. Run Black on it
  2. See error
$ black make_black_sick.py
error: cannot format make_black_sick.py: INTERNAL ERROR: Black produced different code on the second pass of the formatter.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /tmp/blk_frk8cnu0.log
Oh no! 💥 💔 💥

1 file failed to reformat.

blk_frk8cnu0.log

Expected behavior
The file is reformatted

Environment (please complete the following information):

  • Version: black, version 20.8b1
  • OS and Python version: Linux/Python 3.8.6

Does this bug also happen on master?
Yes, show code on black.vercell.app

Additional context
May be related/dupe to #2065

@inftydev inftydev added the T: bug Something isn't working label Apr 22, 2021
@ichard26 ichard26 added C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists labels Apr 22, 2021
@ichard26
Copy link
Collaborator

Hello!

That code issue now formats without error on master.

Since we use the issue tracker as a reflection of what's on master, I'll be closing this issue. If you have any issues, especially with the new (but stable) output, please open a new issue. Oh and the fix should be available in a published release soon, see GH-2125 for more info.

Thank you for reporting!

@ichard26 ichard26 removed the R: duplicate This issue or pull request already exists label Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants