We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Running pp.clean('http://google.com/..........................') takes too much time. Seems like it's a bug.
Running pp.clean('http://google.com/..........................')
To Reproduce
run pp.clean('http://google.com/..........................')
pp.clean('http://google.com/..........................')
Expected behavior
It can return:
'..........................'
''
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
@s @kvtoraman The answer posted here could server as a workaround by skipping cases where the runtime is too long. For example, for the edge case
http://google.com/..........................
The following code will terminate after 2 seconds
import signal import preprocessor as p class TimeoutException(Exception): pass def timeout_handler(signum, frame): raise TimeoutException text_list = ["http://google.com/..........................", "hello world :+1: "] signal.signal(signal.SIGALRM, timeout_handler) for text in text_list: signal.alarm(2) try: text = p.clean(text) except TimeoutException: print(f"Could not handle the {text}") else: signal.alarm(0)
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Running pp.clean('http://google.com/..........................')
takes too much time. Seems like it's a bug.To Reproduce
run
pp.clean('http://google.com/..........................')
Expected behavior
It can return:
'..........................'
''
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: