We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AttributeError: 'IntervalTree' object has no attribute 'search'
Running the latest version of pwntools from pip and python2:

```
In [1]: from pwn import *

In [2]: elf = ELF("./age_calc")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-f9356b282eac> in <module>()
----> 1 elf = ELF("./age_calc")

/home/r2/formatStringExploiter/local/lib/python2.7/site-packages/pwnlib/elf/elf.pyc in __init__(self, path, checksec)
    321
    322             #: Path to the linker for the ELF
--> 323             self.linker = self.read(seg.header.p_vaddr, seg.header.p_memsz)
    324             self.linker = self.linker.rstrip('\x00')
    325

/home/r2/formatStringExploiter/local/lib/python2.7/site-packages/pwnlib/elf/elf.pyc in read(self, address, count)
   1129         stop = address + count
   1130
-> 1131         overlap = self.memory.search(start, stop)
   1132
   1133         # Create a new view of memory, for just what we need

AttributeError: 'IntervalTree' object has no attribute 'search'
```

```
pip freeze
alabaster==0.7.12
asn1crypto==0.24.0
atomicwrites==1.2.1
attrs==18.2.0
Babel==2.6.0
backports.shutil-get-terminal-size==1.0.0
bcrypt==3.1.5
capstone==4.0.0
certifi==2018.11.29
cffi==1.11.5
chardet==3.0.4
CommonMark==0.5.4
cryptography==2.4.2
decorator==4.3.0
docutils==0.14
enum34==1.1.6
filelock==3.0.10
formatStringExploiter==0.1.4
funcsigs==1.0.2
idna==2.8
imagesize==1.1.0
intervaltree==3.0.2
ipaddress==1.0.22
ipython==5.8.0
ipython-genutils==0.2.0
Jinja2==2.10
Mako==1.0.7
MarkupSafe==1.1.0
more-itertools==4.3.0
packaging==18.0
paramiko==2.4.2
pathlib2==2.3.3
pexpect==4.6.0
pickleshare==0.7.5
pkg-resources==0.0.0
pluggy==0.8.0
pockets==0.7.2
prettytable==0.7.2
prompt-toolkit==1.0.15
psutil==5.4.8
ptyprocess==0.6.0
pwntools==3.14.0.dev0
py==1.7.0
pyasn1==0.4.4
pycparser==2.19
pyelftools==0.25
Pygments==2.3.1
PyNaCl==1.3.0
pyparsing==2.3.0
pyserial==3.4
PySocks==1.6.8
pytest==4.0.2
python-dateutil==2.7.5
pytz==2018.7
r2pipe==1.2.0
recommonmark==0.4.0
requests==2.21.0
ROPGadget==5.4
scandir==1.9.0
simplegeneric==0.8.1
six==1.12.0
snowballstemmer==1.2.1
sortedcontainers==1.5.10
Sphinx==1.8.2
sphinx-rtd-theme==0.4.2
sphinxcontrib-napoleon==0.7
sphinxcontrib-websupport==1.1.0
toml==0.10.0
tox==3.6.0
traitlets==4.3.2
typing==3.6.6
unicorn==1.0.1
urllib3==1.24.1
virtualenv==16.1.0
wcwidth==0.1.7
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python2
2 import glob
3 import os
4 import platform
5 import sys
6 import traceback
7 from distutils.command.install import INSTALL_SCHEMES
8 from distutils.sysconfig import get_python_inc
9 from distutils.util import convert_path
10 
11 from setuptools import find_packages
12 from setuptools import setup
13 
14 # Get all template files
15 templates = []
16 for dirpath, dirnames, filenames in os.walk(convert_path('pwnlib/shellcraft/templates'), followlinks=True):
17     for f in filenames:
18         templates.append(os.path.relpath(os.path.join(dirpath, f), 'pwnlib'))
19 
20 # This makes pwntools-LICENSE.txt appear with the package folders
21 for scheme in INSTALL_SCHEMES.values():
22     scheme['data'] = scheme['purelib']
23 
24 console_scripts = ['pwn=pwnlib.commandline.main:main']
25 
26 # Find all of the ancillary console scripts
27 # We have a magic flag --include-all-scripts
28 flag = '--only-use-pwn-command'
29 if flag in sys.argv:
30     sys.argv.remove(flag)
31 else:
32     flag = False
33 
34 for filename in glob.glob('pwnlib/commandline/*'):
35     filename = os.path.basename(filename)
36     filename, ext = os.path.splitext(filename)
37 
38     if ext != '.py' or '__init__' in filename:
39         continue
40 
41     script = '%s=pwnlib.commandline.common:main' % filename
42     if not flag:
43         console_scripts.append(script)
44 
45 install_requires     = ['paramiko>=1.15.2',
46                         'mako>=1.0.0',
47                         'pyelftools>=0.2.4',
48                         'capstone>=3.0.5rc2', # See Gallopsled/pwntools#971, Gallopsled/pwntools#1160
49                         'ropgadget>=5.3',
50                         'pyserial>=2.7',
51                         'requests>=2.0',
52                         'pip>=6.0.8',
53                         'tox>=1.8.1',
54                         'pygments>=2.0',
55                         'pysocks',
56                         'python-dateutil',
57                         'pypandoc',
58                         'packaging',
59                         'psutil>=3.3.0',
60                         'intervaltree',
61                         'sortedcontainers<2.0', # See Gallopsled/pwntools#1154
62                         'unicorn']
63 
64 # Check that the user has installed the Python development headers
65 PythonH = os.path.join(get_python_inc(), 'Python.h')
66 if not os.path.exists(PythonH):
67     print >> sys.stderr, "You must install the Python development headers!"
68     print >> sys.stderr, "$ apt-get install python-dev"
69     sys.exit(-1)
70 
71 # Convert README.md to reStructuredText for PyPI
72 long_description = ''
73 try:
74     import pypandoc
75     try:
76         pypandoc.get_pandoc_path()
77     except OSError:
78         pypandoc.download_pandoc()
79     long_description = pypandoc.convert_file('README.md', 'rst')
80 except ImportError:
81     pass
82 except Exception as e:
83     print >>sys.stderr, "Failed to convert README.md through pandoc, proceeding anyway"
84     traceback.print_exc()
85 
86 
87 setup(
88     name                 = 'pwntools',
89     packages             = find_packages(),
90     version              = '3.12.1',
91     data_files           = [('',
92                              glob.glob('*.md') + glob.glob('*.txt')),
93                             ],
94     package_data         = {
95         'pwnlib': [
96             'data/crcsums.txt',
97             'data/useragents/useragents.txt',
98             'data/binutils/*',
99             'data/includes/*.h',
100             'data/includes/*/*.h',
101             'data/templates/*.mako',
102         ] + templates,
103     },
104     entry_points = {'console_scripts': console_scripts},
105     scripts              = glob.glob("bin/*"),
106     description          = "Pwntools CTF framework and exploit development library.",
107     long_description     = long_description,
108     author               = "Gallopsled et al.",
109     author_email         = "pwntools-users@googlegroups.com",
110     url                  = 'https://pwntools.com',
111     download_url         = "https://github.com/Gallopsled/pwntools/releases",
112     install_requires     = install_requires,
113     license              = "Mostly MIT, some GPL/BSD, see LICENSE-pwntools.txt",
114     keywords             = 'pwntools exploit ctf capture the flag binary wargame overflow stack heap defcon',
115     classifiers          = [
116         'Development Status :: 5 - Production/Stable',
117         'Environment :: Console',
118         'Intended Audience :: Developers',
119         'Intended Audience :: Science/Research',
120         'Intended Audience :: System Administrators',
121         'License :: OSI Approved :: MIT License',
122         'Natural Language :: English',
123         'Operating System :: POSIX :: Linux',
124         'Programming Language :: Python :: 2.7',
125         'Topic :: Security',
126         'Topic :: Software Development :: Assemblers',
127         'Topic :: Software Development :: Debuggers',
128         'Topic :: Software Development :: Disassemblers',
129         'Topic :: Software Development :: Embedded Systems',
130         'Topic :: Software Development :: Libraries :: Python Modules',
131         'Topic :: System :: System Shells',
132         'Topic :: Utilities',
133     ]
134 )
135
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@
                         'pypandoc',
                         'packaging',
                         'psutil>=3.3.0',
-                        'intervaltree',
+                        'intervaltree<3.0', # See Gallopsled/pwntools#1238
                         'sortedcontainers<2.0', # See Gallopsled/pwntools#1154
                         'unicorn']

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -57,7 +57,7 @@\n                         'pypandoc',\n                         'packaging',\n                         'psutil>=3.3.0',\n-                        'intervaltree',\n+                        'intervaltree<3.0', # See Gallopsled/pwntools#1238\n                         'sortedcontainers<2.0', # See Gallopsled/pwntools#1154\n                         'unicorn']\n", "issue": "AttributeError: 'IntervalTree' object has no attribute 'search'\nRunning the latest version of pwntools from pip and python2:\r\n\r\n```\r\nIn [1]: from pwn import *\r\n\r\nIn [2]: elf = ELF(\"./age_calc\")\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-2-f9356b282eac> in <module>()\r\n----> 1 elf = ELF(\"./age_calc\")\r\n\r\n/home/r2/formatStringExploiter/local/lib/python2.7/site-packages/pwnlib/elf/elf.pyc in __init__(self, path, checksec)\r\n    321\r\n    322             #: Path to the linker for the ELF\r\n--> 323             self.linker = self.read(seg.header.p_vaddr, seg.header.p_memsz)\r\n    324             self.linker = self.linker.rstrip('\\x00')\r\n    325\r\n\r\n/home/r2/formatStringExploiter/local/lib/python2.7/site-packages/pwnlib/elf/elf.pyc in read(self, address, count)\r\n   1129         stop = address + count\r\n   1130\r\n-> 1131         overlap = self.memory.search(start, stop)\r\n   1132\r\n   1133         # Create a new view of memory, for just what we need\r\n\r\nAttributeError: 'IntervalTree' object has no attribute 'search'\r\n```\r\n\r\n```\r\npip freeze\r\nalabaster==0.7.12\r\nasn1crypto==0.24.0\r\natomicwrites==1.2.1\r\nattrs==18.2.0\r\nBabel==2.6.0\r\nbackports.shutil-get-terminal-size==1.0.0\r\nbcrypt==3.1.5\r\ncapstone==4.0.0\r\ncertifi==2018.11.29\r\ncffi==1.11.5\r\nchardet==3.0.4\r\nCommonMark==0.5.4\r\ncryptography==2.4.2\r\ndecorator==4.3.0\r\ndocutils==0.14\r\nenum34==1.1.6\r\nfilelock==3.0.10\r\nformatStringExploiter==0.1.4\r\nfuncsigs==1.0.2\r\nidna==2.8\r\nimagesize==1.1.0\r\nintervaltree==3.0.2\r\nipaddress==1.0.22\r\nipython==5.8.0\r\nipython-genutils==0.2.0\r\nJinja2==2.10\r\nMako==1.0.7\r\nMarkupSafe==1.1.0\r\nmore-itertools==4.3.0\r\npackaging==18.0\r\nparamiko==2.4.2\r\npathlib2==2.3.3\r\npexpect==4.6.0\r\npickleshare==0.7.5\r\npkg-resources==0.0.0\r\npluggy==0.8.0\r\npockets==0.7.2\r\nprettytable==0.7.2\r\nprompt-toolkit==1.0.15\r\npsutil==5.4.8\r\nptyprocess==0.6.0\r\npwntools==3.14.0.dev0\r\npy==1.7.0\r\npyasn1==0.4.4\r\npycparser==2.19\r\npyelftools==0.25\r\nPygments==2.3.1\r\nPyNaCl==1.3.0\r\npyparsing==2.3.0\r\npyserial==3.4\r\nPySocks==1.6.8\r\npytest==4.0.2\r\npython-dateutil==2.7.5\r\npytz==2018.7\r\nr2pipe==1.2.0\r\nrecommonmark==0.4.0\r\nrequests==2.21.0\r\nROPGadget==5.4\r\nscandir==1.9.0\r\nsimplegeneric==0.8.1\r\nsix==1.12.0\r\nsnowballstemmer==1.2.1\r\nsortedcontainers==1.5.10\r\nSphinx==1.8.2\r\nsphinx-rtd-theme==0.4.2\r\nsphinxcontrib-napoleon==0.7\r\nsphinxcontrib-websupport==1.1.0\r\ntoml==0.10.0\r\ntox==3.6.0\r\ntraitlets==4.3.2\r\ntyping==3.6.6\r\nunicorn==1.0.1\r\nurllib3==1.24.1\r\nvirtualenv==16.1.0\r\nwcwidth==0.1.7\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python2\nimport glob\nimport os\nimport platform\nimport sys\nimport traceback\nfrom distutils.command.install import INSTALL_SCHEMES\nfrom distutils.sysconfig import get_python_inc\nfrom distutils.util import convert_path\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n# Get all template files\ntemplates = []\nfor dirpath, dirnames, filenames in os.walk(convert_path('pwnlib/shellcraft/templates'), followlinks=True):\n    for f in filenames:\n        templates.append(os.path.relpath(os.path.join(dirpath, f), 'pwnlib'))\n\n# This makes pwntools-LICENSE.txt appear with the package folders\nfor scheme in INSTALL_SCHEMES.values():\n    scheme['data'] = scheme['purelib']\n\nconsole_scripts = ['pwn=pwnlib.commandline.main:main']\n\n# Find all of the ancillary console scripts\n# We have a magic flag --include-all-scripts\nflag = '--only-use-pwn-command'\nif flag in sys.argv:\n    sys.argv.remove(flag)\nelse:\n    flag = False\n\nfor filename in glob.glob('pwnlib/commandline/*'):\n    filename = os.path.basename(filename)\n    filename, ext = os.path.splitext(filename)\n\n    if ext != '.py' or '__init__' in filename:\n        continue\n\n    script = '%s=pwnlib.commandline.common:main' % filename\n    if not flag:\n        console_scripts.append(script)\n\ninstall_requires     = ['paramiko>=1.15.2',\n                        'mako>=1.0.0',\n                        'pyelftools>=0.2.4',\n                        'capstone>=3.0.5rc2', # See Gallopsled/pwntools#971, Gallopsled/pwntools#1160\n                        'ropgadget>=5.3',\n                        'pyserial>=2.7',\n                        'requests>=2.0',\n                        'pip>=6.0.8',\n                        'tox>=1.8.1',\n                        'pygments>=2.0',\n                        'pysocks',\n                        'python-dateutil',\n                        'pypandoc',\n                        'packaging',\n                        'psutil>=3.3.0',\n                        'intervaltree',\n                        'sortedcontainers<2.0', # See Gallopsled/pwntools#1154\n                        'unicorn']\n\n# Check that the user has installed the Python development headers\nPythonH = os.path.join(get_python_inc(), 'Python.h')\nif not os.path.exists(PythonH):\n    print >> sys.stderr, \"You must install the Python development headers!\"\n    print >> sys.stderr, \"$ apt-get install python-dev\"\n    sys.exit(-1)\n\n# Convert README.md to reStructuredText for PyPI\nlong_description = ''\ntry:\n    import pypandoc\n    try:\n        pypandoc.get_pandoc_path()\n    except OSError:\n        pypandoc.download_pandoc()\n    long_description = pypandoc.convert_file('README.md', 'rst')\nexcept ImportError:\n    pass\nexcept Exception as e:\n    print >>sys.stderr, \"Failed to convert README.md through pandoc, proceeding anyway\"\n    traceback.print_exc()\n\n\nsetup(\n    name                 = 'pwntools',\n    packages             = find_packages(),\n    version              = '3.12.1',\n    data_files           = [('',\n                             glob.glob('*.md') + glob.glob('*.txt')),\n                            ],\n    package_data         = {\n        'pwnlib': [\n            'data/crcsums.txt',\n            'data/useragents/useragents.txt',\n            'data/binutils/*',\n            'data/includes/*.h',\n            'data/includes/*/*.h',\n            'data/templates/*.mako',\n        ] + templates,\n    },\n    entry_points = {'console_scripts': console_scripts},\n    scripts              = glob.glob(\"bin/*\"),\n    description          = \"Pwntools CTF framework and exploit development library.\",\n    long_description     = long_description,\n    author               = \"Gallopsled et al.\",\n    author_email         = \"pwntools-users@googlegroups.com\",\n    url                  = 'https://pwntools.com',\n    download_url         = \"https://github.com/Gallopsled/pwntools/releases\",\n    install_requires     = install_requires,\n    license              = \"Mostly MIT, some GPL/BSD, see LICENSE-pwntools.txt\",\n    keywords             = 'pwntools exploit ctf capture the flag binary wargame overflow stack heap defcon',\n    classifiers          = [\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Console',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Science/Research',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: MIT License',\n        'Natural Language :: English',\n        'Operating System :: POSIX :: Linux',\n        'Programming Language :: Python :: 2.7',\n        'Topic :: Security',\n        'Topic :: Software Development :: Assemblers',\n        'Topic :: Software Development :: Debuggers',\n        'Topic :: Software Development :: Disassemblers',\n        'Topic :: Software Development :: Embedded Systems',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Topic :: System :: System Shells',\n        'Topic :: Utilities',\n    ]\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python2\nimport glob\nimport os\nimport platform\nimport sys\nimport traceback\nfrom distutils.command.install import INSTALL_SCHEMES\nfrom distutils.sysconfig import get_python_inc\nfrom distutils.util import convert_path\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n# Get all template files\ntemplates = []\nfor dirpath, dirnames, filenames in os.walk(convert_path('pwnlib/shellcraft/templates'), followlinks=True):\n    for f in filenames:\n        templates.append(os.path.relpath(os.path.join(dirpath, f), 'pwnlib'))\n\n# This makes pwntools-LICENSE.txt appear with the package folders\nfor scheme in INSTALL_SCHEMES.values():\n    scheme['data'] = scheme['purelib']\n\nconsole_scripts = ['pwn=pwnlib.commandline.main:main']\n\n# Find all of the ancillary console scripts\n# We have a magic flag --include-all-scripts\nflag = '--only-use-pwn-command'\nif flag in sys.argv:\n    sys.argv.remove(flag)\nelse:\n    flag = False\n\nfor filename in glob.glob('pwnlib/commandline/*'):\n    filename = os.path.basename(filename)\n    filename, ext = os.path.splitext(filename)\n\n    if ext != '.py' or '__init__' in filename:\n        continue\n\n    script = '%s=pwnlib.commandline.common:main' % filename\n    if not flag:\n        console_scripts.append(script)\n\ninstall_requires     = ['paramiko>=1.15.2',\n                        'mako>=1.0.0',\n                        'pyelftools>=0.2.4',\n                        'capstone>=3.0.5rc2', # See Gallopsled/pwntools#971, Gallopsled/pwntools#1160\n                        'ropgadget>=5.3',\n                        'pyserial>=2.7',\n                        'requests>=2.0',\n                        'pip>=6.0.8',\n                        'tox>=1.8.1',\n                        'pygments>=2.0',\n                        'pysocks',\n                        'python-dateutil',\n                        'pypandoc',\n                        'packaging',\n                        'psutil>=3.3.0',\n                        'intervaltree<3.0', # See Gallopsled/pwntools#1238\n                        'sortedcontainers<2.0', # See Gallopsled/pwntools#1154\n                        'unicorn']\n\n# Check that the user has installed the Python development headers\nPythonH = os.path.join(get_python_inc(), 'Python.h')\nif not os.path.exists(PythonH):\n    print >> sys.stderr, \"You must install the Python development headers!\"\n    print >> sys.stderr, \"$ apt-get install python-dev\"\n    sys.exit(-1)\n\n# Convert README.md to reStructuredText for PyPI\nlong_description = ''\ntry:\n    import pypandoc\n    try:\n        pypandoc.get_pandoc_path()\n    except OSError:\n        pypandoc.download_pandoc()\n    long_description = pypandoc.convert_file('README.md', 'rst')\nexcept ImportError:\n    pass\nexcept Exception as e:\n    print >>sys.stderr, \"Failed to convert README.md through pandoc, proceeding anyway\"\n    traceback.print_exc()\n\n\nsetup(\n    name                 = 'pwntools',\n    packages             = find_packages(),\n    version              = '3.12.1',\n    data_files           = [('',\n                             glob.glob('*.md') + glob.glob('*.txt')),\n                            ],\n    package_data         = {\n        'pwnlib': [\n            'data/crcsums.txt',\n            'data/useragents/useragents.txt',\n            'data/binutils/*',\n            'data/includes/*.h',\n            'data/includes/*/*.h',\n            'data/templates/*.mako',\n        ] + templates,\n    },\n    entry_points = {'console_scripts': console_scripts},\n    scripts              = glob.glob(\"bin/*\"),\n    description          = \"Pwntools CTF framework and exploit development library.\",\n    long_description     = long_description,\n    author               = \"Gallopsled et al.\",\n    author_email         = \"pwntools-users@googlegroups.com\",\n    url                  = 'https://pwntools.com',\n    download_url         = \"https://github.com/Gallopsled/pwntools/releases\",\n    install_requires     = install_requires,\n    license              = \"Mostly MIT, some GPL/BSD, see LICENSE-pwntools.txt\",\n    keywords             = 'pwntools exploit ctf capture the flag binary wargame overflow stack heap defcon',\n    classifiers          = [\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Console',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Science/Research',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: MIT License',\n        'Natural Language :: English',\n        'Operating System :: POSIX :: Linux',\n        'Programming Language :: Python :: 2.7',\n        'Topic :: Security',\n        'Topic :: Software Development :: Assemblers',\n        'Topic :: Software Development :: Debuggers',\n        'Topic :: Software Development :: Disassemblers',\n        'Topic :: Software Development :: Embedded Systems',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Topic :: System :: System Shells',\n        'Topic :: Utilities',\n    ]\n)\n", "path": "setup.py"}]}