Skip to content

Instantly share code, notes, and snippets.

@boyxuper
Created January 26, 2016 12:07
Show Gist options
  • Save boyxuper/bcdd811a540405feab0d to your computer and use it in GitHub Desktop.
Save boyxuper/bcdd811a540405feab0d to your computer and use it in GitHub Desktop.
urllib3==1.14 AttributeError: 'bool' object has no attribute 'close'
#!/usr/bin/env python
import urllib3.poolmanager
pool = urllib3.poolmanager.HTTPConnectionPool('127.0.0.1', 9900)
resp = pool.urlopen('GET', '/', timeout=1)
print resp.data
#!/usr/bin/env python
import time
import socket
s = socket.socket()
s.bind(('', 9900))
while True:
s.listen(1)
cs, addr = s.accept()
print cs.recv(65535)
cs.send('''HTTP/1.0 200 OK\n\n''')
time.sleep(3)
cs.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment