Open DIV-on-github opened 4 years ago
I forgot to say that in the second instance while the debugger seemed to be stuck (as if processing an infinite loop or something) I went to the variables explorer pane and tried to copy a string variable's content, which was the path to a file.
After no immediate response, after 5 to 10 seconds I got several warning/error messages stating that the variable was too big to copy.
These are pretty annoying, because when they happen the only thing to do is close down the console or the kernel. The button to "Stop the current command" doesn't work at all.
I am stepping through the second issue, and the code hangs when it gets to
the last line of
def _compile(pattern, flags):
which is
return p
By the way, although the source text is someone long (about 15 MB), that is not the cause of the problem. The same code can be run successfully on files of similar content that are twice as large (although it might take a dozen seconds, it doesn't hang for the other files I read in).
@DIV-on-github thanks for the report.
Could you please share with us a minimal reproducible example of what you are doing step by step (with some example content) so that we can reproduce it on our side?
Thanks
I would like to, but it could be a large amount of work for me to find the responsible characters in the files that are read in, because:
(1) often they can be analysed without error; and
(2) previously every time the analysis failed Spyder would hang for an unlimited amount of time.
I finally managed to implement the wrapt_timeout_decorator
https://github.com/bitranox/wrapt_timeout_decorator/blob/master/README.rst#use-with-windows
so that at least I can get an exception after a specified duration.
If I can isolate it further I'll report back.
Description
What steps will reproduce the problem?
I am parsing a file containing all sorts of weird characters, but treating it as if it were ANSI.
I have a somewhat complicated regex expression.
The regex search sometimes fails in two ways. (1) More commonly the generator from re.finditer seems to be successfully created, but when looping with a "for ... in ...:" structure after iterating through to the last genuine match, it then loops to a further fictious match and then hangs. That is when running the file normally or in the debugger.
(2) In this case I was debugging and the regex hung immediately after calling re.search (in an imported module).
Traceback
Versions
Dependencies