##// END OF EJS Templates
filter-traceback: simplify handling...
marmoute -
r53407:4f9a3347 default
parent child Browse files
Show More
@@ -15,37 +15,14 sys.stdout = io.TextIOWrapper(
15 line_buffering=sys.stdout.line_buffering,
15 line_buffering=sys.stdout.line_buffering,
16 )
16 )
17
17
18 state = 'none'
18 in_tb = False
19
19
20 for line in sys.stdin:
20 for line in sys.stdin:
21 if state == 'none':
21 do_print = not in_tb
22 if line.startswith('Traceback '):
22 if line.startswith('Traceback '):
23 state = 'tb'
23 in_tb = True
24
24 elif not line.startswith(' '):
25 elif state == 'tb':
25 in_tb = False
26 if line.startswith(' File '):
26 do_print = True
27 state = 'file'
27 if do_print:
28 continue
28 print(line, end='')
29
30 elif not line.startswith(' '):
31 state = 'none'
32
33 elif not line.replace('^', '').replace('~', '').strip():
34 # PEP 657: Fine-grained error locations in tracebacks
35 # ~~~~~~^^^^^^^^^
36 continue
37 elif line.startswith(' '):
38 # Python 3.13 provide de full statement context
39 continue
40
41 elif state == 'file':
42 # Ignore one line after " File ", but sometimes "File" lines are
43 # contiguous:
44 # File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
45 # File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
46 # File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
47 if not line.startswith(' File '):
48 state = 'tb'
49 continue
50
51 print(line, end='')
@@ -246,8 +246,6 Now do a variation using POST to send ar
246 read limit reached; closing socket
246 read limit reached; closing socket
247 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
247 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
248 Traceback (most recent call last):
248 Traceback (most recent call last):
249 rctx, req, res, self.check_perm (py313 !)
250 ) (py313 !)
251 Exception: connection closed after receiving N bytes
249 Exception: connection closed after receiving N bytes
252
250
253
251
General Comments 0
You need to be logged in to leave comments. Login now