twitter-text-python icon indicating copy to clipboard operation
twitter-text-python copied to clipboard

A pathless url followed by a lot of hyphens will hang the parser indefinitely

Open lextoumbourou opened this issue 8 years ago • 0 comments

Super edge case-y behaviour, but a Tweet that looks like this: http://somesite.com-------------------------------- (which is a valid Tweet), will hang the parser indefinitely or at least for a very long time.

Here's a complete example:

from ttp import ttp
parser = ttp.Parser()
parser.parse('http://somesite.com--------------------------------')

You'll note that it never completes. Smells a lot like catastrophic backtracking.

lextoumbourou avatar Oct 12 '17 01:10 lextoumbourou