Skip to content

Instantly share code, notes, and snippets.

@NelsonMinar
Created March 30, 2016 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NelsonMinar/7e52fdb8e5b1e2d3b15b70eb3f5ae586 to your computer and use it in GitHub Desktop.
Save NelsonMinar/7e52fdb8e5b1e2d3b15b70eb3f5ae586 to your computer and use it in GitHub Desktop.
Demo program for a small bug with discord.py closing sessions
# Demo of a bug in discord.py 0.10.0-alpha (tested with 53a240e)
# This program causes the following error to be printed when Python exits
# Unclosed client session
# client_session: <aiohttp.client.ClientSession object at 0x7f3bd7a83358>
import discord
c = discord.Client()
c.close()
# Adding this line seems to fix the problem
# c.session.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment