This file is indexed.

/usr/lib/python3/dist-packages/exabgp/debug.py is in python3-exabgp 4.0.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# encoding: utf-8
"""
debug.py

Created by Thomas Mangin on 2011-03-29.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""

import os
import sys
from exabgp.util.panic import PANIC
from exabgp.util.panic import FOOTER


def bug_report (dtype, value, trace):
	sys.stdout.flush()
	sys.stderr.flush()

	print(PANIC)
	sys.stdout.flush()
	sys.stderr.flush()

	import traceback

	print("-- Traceback\n\n")
	traceback.print_exception(dtype,value,trace)

	from exabgp.logger import Logger
	logger = Logger()

	print("\n\n-- Configuration\n\n")
	print(logger.config())
	print("\n\n-- Logging History\n\n")
	print(logger.history())
	print("\n\n\n")

	print(FOOTER)
	sys.stdout.flush()
	sys.stderr.flush()


def intercept (dtype, value, trace):
	bug_report(dtype, value, trace)
	if os.environ.get('PDB',None) not in [None,'0','']:
		import pdb
		pdb.pm()


def setup_report ():
	sys.excepthook = intercept