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: Black produced different code on the second pass of the formatter #1911

Closed
fccagou opened this issue Jan 7, 2021 · 2 comments
Labels
C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@fccagou
Copy link

fccagou commented Jan 7, 2021

Hello. First of all, Happy New Year \o/ !

I've an error while parsing my pyap code
using black, version 20.8b1 on up to date Arch system.

It used to change

output += """ a long.....line""" % (param1,param2)
on the first pass

    output += (
               """ a long.....line""" 
               % (
                      param1,
                      param2,
                )
     )

On the second pass

    output += """ a long.....line""" % (
               param1,
               param2,
     )

First pass seems buggy.

Thx for your job 👍

@ichard26 ichard26 added C: unstable formatting Formatting changed on the second pass T: bug Something isn't working labels Jan 8, 2021
@mvolfik
Copy link

mvolfik commented Feb 22, 2021

MCVE:

def f():
    try:
        if security_alert_manager.got_alert:
            output += """<div class="gq gg ala"><div class="%s"><div class="alz"><span class="anj"> %s</span></div><div class="desc"><p>%s</p><p><span class="ok nb">%s</span><span class="warn nb">%s</span><span class="crit nb">%s</span><span class="unknown nb">%s</span></p></div></div></div>""" % (cssclass, p, detail_url, poller_status['services']['ok'], poller_status['services']['warn'], poller_status['services']['crit'], poller_status['services']['unknown'])
    except: pass

Likely a duplicate of #1629 , as this file works after applying #1958

@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Apr 25, 2021
@ichard26
Copy link
Collaborator

Hello!

All reproduction cases in this issue format without error on master. The fixing commit was 8672af3 from PR GH-2126. I'll be marking this issue as a duplicate of GH-1629 since that's what GH-2126 aimed to fix and it's highly likely this issue falls under GH-1629.

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!

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 R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants