#228 Python parser enters endless loop on commented triple string

open-fixed
None
5
2008-06-11
2008-06-08
Enrico Tröger
No

The Python parser enters an endless loop when an opened triple string is closed and there is a comment character before on the same line (see testcase).

The attached patch tries to solve this by ignoring comment characters only if the current line is not part of a multiline string.
Maybe there is a better way to solve this.

Discussion

  • Enrico Tröger
    Enrico Tröger
    2008-06-08

    Test case

     
    Attachments
  • Enrico Tröger
    Enrico Tröger
    2008-06-08

    Possible fix

     
  • Enrico Tröger
    Enrico Tröger
    2008-06-08

    Logged In: YES
    user_id=1117045
    Originator: YES

    File Added: triple_string_loop.patch

     
  • Logged In: YES
    user_id=32894
    Originator: NO

    Ah, how extremely embarrassing. Guess this is even some kind of security issue. Also embarrassing how I reported this for geany the other day (where I saw your fix and recognized my own code, leading me to check back on this tracker..). Small world :)

    In any case, I applied your patch (plus the fix I saw in geany) in revision 668. Thanks a lot.

     
    • status: open --> open-fixed
     
    • assigned_to: nobody --> elias