title: Closing asyncio event loop in Python causes exception at end
body: <p>For https requests using asyncio and aiohttp in Python 3.4 on Windows I'll need to use 2 event loops. A ProactorEventLoop for running shell commands, and the default event loop for HTTPS requests. The ProactorEventLoop does not work for HTTPS commands, unfortunately. </p>
  
  <p>The following code below shows what happens when I use a newly created default event loop and try to close it at the end on Windows. I get exceptions at the end if I call <code>loop.close</code> at the end as shown below:</p>
  
  <pre><code>&gt; Traceback (most recent call last):
  &gt;  File "C:\BuildUtilities\p3.4env0\lib\site-packages\aiohttp\connector.py", line 56, in __del__
  &gt;    self.close()
  &gt;  File "C:\BuildUtilities\p3.4env0\lib\site-packages\aiohttp\connector.py", line 97, in close
  &gt;    transport.close()
  &gt;  File "C:\Python34\Lib\asyncio\selector_events.py", line 375, in close
  &gt;    self._loop.remove_reader(self._sock_fd)
  &gt;  File "C:\Python34\Lib\asyncio\selector_events.py", line 155, in remove_reader
  &gt;    key = self._selector.get_key(fd)
  &gt; AttributeError: 'NoneType' object has no attribute 'get_key'
  </code></pre>
  
  <p>Commenting it out removes the exception and I don't know why. The one and only </p>
  
  <pre><code>import asyncio
  import aiohttp
  
  @asyncio.coroutine
  def get_body(url):
      response = yield from aiohttp.request('GET', url)
      return (yield from response.read_and_close())
  
  #loop = asyncio.ProactorEventLoop()
  loop = asyncio.new_event_loop()
  asyncio.set_event_loop(loop)
  
  f = asyncio.async( get_body('https://www.google.com') )
  try:
      loop.run_until_complete(f)
  except Exception as e:
      print(e)
  
  if f.result():
      print(f.result())
  
  loop.close()
  </code></pre>
  
  <p>Thanks,
  greenaj</p>