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
{{ message }}
Repository navigation
Formatting bug? Triple-quote changed to 2x triple-quote #923
Then format it using pyugprade 3.15.0 and then check the comment near line 234. It will change to:
defpracownicy(self):
"""Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli aktualni pracownicy, obecni pracownicy"""y"""
returnAutor.objects.filter(pk__in=self.aktualni_autorzy(), pokazuj=True)
Is this a known bug? Is there something wrong with my code?
I can reproduce, running pyupgrade 3.15.0 on Python 3.12.1 with no options on:
defthing():
"""Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli aktualni pracownicy, obecni pracownicy"""
...
Gives:
defthing():
"""Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli aktualni pracownicy, obecni pracownicy"""y"""
...
def thing():
"""Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli
- aktualni pracownicy, obecni pracownicy"""+ aktualni pracownicy, obecni pracownicy"""y"""
...
this is a bug in cpython -- please report there. here's a little testcase you can take too:
importioimporttokenizesrc='''\def thing(): """Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli aktualni pracownicy, obecni pracownicy""" ...'''tokens=list(tokenize.generate_tokens(io.StringIO(src).readline))
asserttokens[7].end== (3, 45), tokens[7].end
Activity
asottile commentedon Dec 9, 2023
can't reproduce -- must be some other tool that you're confusing for pyupgrade
mpasternak commentedon Dec 9, 2023
I am able to reproduce it on a clean virtualenvironment with this versions:
mpasternak commentedon Dec 9, 2023
... and I have exactly the same behavior with version installed from git.
Which version of pyupgrade were you using that you're unable to reproduce it?
hugovk commentedon Dec 9, 2023
I can reproduce, running pyupgrade 3.15.0 on Python 3.12.1 with no options on:
Gives:
def thing(): """Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli - aktualni pracownicy, obecni pracownicy""" + aktualni pracownicy, obecni pracownicy"""y""" ...asottile commentedon Dec 9, 2023
alright I can with 3.12 now. I had only tried 3.8 and 3.10 and the versions you claimed
next time include your actual information in your report
asottile commentedon Dec 9, 2023
this is a bug in cpython -- please report there. here's a little testcase you can take too:
mpasternak commentedon Dec 9, 2023
Will do, thanks for taking time to analyze this @asottile & @hugovk
asottile commentedon Dec 9, 2023
you can work around this by ensuring your docstrings are ascii-only
hugovk commentedon Dec 10, 2023
Reported to CPython at python/cpython#112943.
mpasternak commentedon Dec 10, 2023
@hugovk thanks, I planned to report it some time later, but the way you did it is obviously much more professional than I could ever come up with.
I'm just a small developer doing my own thing, I did not expect that such a small minor bug would reach cpython repo. Thank you!