Code Monkey home page Code Monkey logo

Comments (7)

asottile avatar asottile commented on September 21, 2024 1

this isn't the first time this has happened. 3.8.0 was also completely broken in some very niche cases that we can't really work around either

from flake8.

matejsp avatar matejsp commented on September 21, 2024

I think I have located the problematic part of code:

print(
    '''Id,ProgramId,ProgramName,ProfileId,IpAddress,EventDate,MediaId,MediaName,AdId,AdName,AdType
        "clickId1",14006,Test,"profileId1",ip1,2022-08-20T13:27:35+0200,1,"Joe Doeツ",adId1,Online,1
        "clickId2",14006,Test,"profileId1",ip1,2022-08-20T13:39:51+0200,1,"Joe Doeツ",adId2,Online,2'''
)

save this under somename bla.py and run flake8 bla.py

Moving last ) to previous line ... fixes the problem (but black is not happy).

from flake8.

asottile avatar asottile commented on September 21, 2024

there's a bug in python 3.12.0 and 3.12.1 with multiline strings containing non-ascii characters -- would it be too much to ask if your error is fixed with the unreleased cpython main branch?

from flake8.

matejsp avatar matejsp commented on September 21, 2024

Yes I have tried and it works.

3.12.1 -> borked with IndexError: string index out of range

pyenv install 3.12-dev
3.12-dev -> runned OK

Any idea how to work around this or handle this error gracefully on every 3.12 version?
Like ignoring the error or skipping the checks for such strings.

from flake8.

sigmavirus24 avatar sigmavirus24 commented on September 21, 2024

@matejsp when the underlying language is so broken that all prior versions and newer versions work, why would we attempt to fix such a narrow use-case when people are likely to get the fixed version? We can't possibly maintain tiny papercut fixes for every fundamental language flaw

from flake8.

matejsp avatar matejsp commented on September 21, 2024

The only reason that comes to my mind is that you can't get a working version of 3.12. Well not yet anyway. Not to mention waiting for distros to catchup. It will take another month to be relesed (every two months for bugfix release). And couple of months for all the distros.

I understand that you can't maintain papercut fixed for language flaws. But this is official and latest and current release of python. This is hinders the upgrade to latest python version (just my opinion anyway). If you would get something like false positive or negative it would be fine. But it completely crashes flake8 making it unusable. I see it more about making flake8 code more resiliant (even for unexpected input than maintaining papercut fixes).

Can you point me to upstream bug? Tried searching https://github.com/python/cpython/issues but was not able to find the issue. Is this specific to flake8 ast analysis or poses more deep runtime problem so whole python 3.12 should be avoided as a whole? If it would be so critial they would probably scrape the 3.12 release or make immediate hotfix.

from flake8.

asottile avatar asottile commented on September 21, 2024

python/cpython#112943

from flake8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.