PennyDreadfulMTG / Penny-Dreadful-Tools

A suite of tools for the Penny Dreadful MTGO community
https://pennydreadfulmagic.com
MIT License
40 stars 28 forks source link

Command failed with ClientRequestError: !art Survive the Night #4314

Closed vorpal-buildbot closed 6 years ago

vorpal-buildbot commented 6 years ago
Traceback (most recent call last):
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 407, in write_bytes
    result = stream.send(value)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/helpers.py", line 191, in _gen_form_data
    yield from self._writer.serialize()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 969, in serialize
    yield from part.serialize()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 768, in serialize
    yield from self._maybe_encode_stream(self._serialize_obj())
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 781, in _serialize_obj
    return self._serialize_default(obj)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 813, in _serialize_default
    raise TypeError('unknown body part type %r' % type(obj))
TypeError: unknown body part type <class 'bool'>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 66, in handle_command
    await method(Commands, bot, message.channel, args, message.author)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 467, in art
    await bot.send_image_with_retry(channel, image_file)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 101, in send_image_with_retry
    message = await self.client.send_file(channel, image_file, content=text)
  File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 1235, in send_file
    filename=filename, content=content, tts=tts)
  File "/home/discord/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
    r = yield from self.session.request(method, url, **kwargs)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
    resp = yield from self._coro
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 202, in _request
    yield from resp.start(conn, read_until_eof)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 640, in start
    message = yield from httpstream.read()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 641, in read
    result = yield from super().read()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 476, in read
    yield from self._waiter
aiohttp.errors.ClientRequestError: Can not write request body for https://discordapp.com/api/v6/channels/357768867755327489/messages

Reported on Discord by silasary#2393

bakert commented 6 years ago

This is very reproducible.!art seemingly isn't working at all.

bakert commented 6 years ago
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=pitiless+horde in images/pitiless-horde.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Wall of Razors, Plumeveil
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=wall+of+razors%7cplumeveil in images/wall-of-razors_plumeveil.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Reckless Fireweaver
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=reckless+fireweaver in images/reckless-fireweaver.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Servo Schematic
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=servo+schematic in images/servo-schematic.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Atog, Ravenous Intruder
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=atog%7cravenous+intruder in images/atog_ravenous-intruder.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Fetching https://api.scryfall.com/cards (cache ok)
Feb 22 03:55:12 katelyngigante bash[15835]: Fetching https://pennydreadfulmtg.github.io/modo-bugs/bugs.json (cache ok)
Feb 22 03:55:12 katelyngigante bash[15835]: diff=118795.34764003754, timer=7195.347640037537
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Implement of Combustion, Disciple of the Vault
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=implement+of+combustion%7cdisciple+of+the+vault in images/implement-of-combustion_disciple-of-the-vault.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Fetching http://vorpald20.com:5800/Disciple of the Vault/ (cache ok)
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Scrapyard Salvo, Kiln Fiend
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=scrapyard+salvo%7ckiln+fiend in images/scrapyard-salvo_kiln-fiend.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Slag Fiend
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=slag+fiend in images/slag-fiend.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: ULeeT started streaming
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Salvage Titan
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=salvage+titan in images/salvage-titan.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: <@413931580390637572> joined Gatherling.com (379082671743172611)
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Recurring Nightmare
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=recurring+nightmare in images/recurring-nightmare.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Fetching https://api.scryfall.com/cards/search?q=f%3apd+o%3aaffinity (cache ok)
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Assert Authority, Broodstar, Chromescale Drake, Dross Golem
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=assert+authority%7cbroodstar%7cchromescale+drake%7cdross+golem in images/assert-authority_broodstar_chromescale-drake_dross-golem.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: ULeeT no longer streaming
Feb 22 03:55:12 katelyngigante bash[15835]: ULeeT started streaming
Feb 22 03:55:12 katelyngigante bash[15835]: ULeeT no longer streaming
Feb 22 03:55:12 katelyngigante bash[15835]: ULeeT started streaming
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Carrier Thrall
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=carrier+thrall in images/carrier-thrall.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Blisterpod
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=blisterpod in images/blisterpod.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get image for Halcyon Glaze
Feb 22 03:55:12 katelyngigante bash[15835]: Storing http://magic.bluebones.net/proxies/index2.php?c=halcyon+glaze in images/halcyon-glaze.jpg
Feb 22 03:55:12 katelyngigante bash[15835]: Trying to get scryfall image for Card({'id': 26746, 'layout': 'normal', 'face_id': 26746, 'name': 'Survive the Night', 'mana_cost': ['{2}{W}'], 'cmc': 3.0, 'power': None, 'toughness': None, 'loyalty': None, 'type': 'Instant', 'text': 'Target creature gets +1/+0 and gains indestructible until end of turn. (Damage and effects that say "destroy" don\'t destroy it.)\nInvestigate. (Create a colorless Clue artifact token with "{2}, Sacrifice this artifact: Draw a card.")', 'search_text': 'Target creature gets +1/+0 and gains indestructible until end of turn. \nInvestigate. ', 'image_name': 'survive the night', 'hand': None, 'life': None, 'starter': None, 'position': '1', 'name_ascii': 'Survive the Night', 'card_id': '26746', 'names': ['Survive the Night'], 'legalities': {'Commander': 'Legal', 'Legacy': 'Legal', 'Modern': 'Legal', 'Vintage': 'Legal', 'Shadows over Innistrad Block': 'Legal', 'Penny Dreadful': 'Legal', 'Penny Dreadful EMN': 'Legal', 'Penny Dreadful KLD': 'Legal', 'Penny Dreadful AER': 'Legal', 'Penny Dreadful AKH': 'Legal', 'Penny Dreadful HOU': 'Legal', 'Penny Dreadful XLN': 'Legal'}, 'pd_legal': 1, 'bugs': None, 'mode': 0})
Feb 22 03:55:13 katelyngigante bash[15835]: Task exception was never retrieved
Feb 22 03:55:13 katelyngigante bash[15835]: future: <Task finished coro=<ClientRequest.write_bytes() done, defined at /home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py:388> exception=CancelledError()>
Feb 22 03:55:13 katelyngigante bash[15835]: concurrent.futures._base.CancelledError
Feb 22 03:55:29 katelyngigante bash[15835]: Ignoring exception in on_message
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 463, in write_bytes
Feb 22 03:55:29 katelyngigante bash[15835]:     request.transport.set_tcp_nodelay(True)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/parsers.py", line 255, in set_tcp_nodelay
Feb 22 03:55:29 katelyngigante bash[15835]:     self._socket.setsockopt(socket.IPPROTO_TCP, CORK, False)
Feb 22 03:55:29 katelyngigante bash[15835]: OSError: [Errno 9] Bad file descriptor
Feb 22 03:55:29 katelyngigante bash[15835]: The above exception was the direct cause of the following exception:
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
Feb 22 03:55:29 katelyngigante bash[15835]:     yield from getattr(self, event)(*args, **kwargs)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 140, in on_message
Feb 22 03:55:29 katelyngigante bash[15835]:     await BOT.on_message(message)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 42, in on_message
Feb 22 03:55:29 katelyngigante bash[15835]:     await self.respond_to_command(message)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 59, in respond_to_command
Feb 22 03:55:29 katelyngigante bash[15835]:     await command.handle_command(message, self)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 80, in handle_command
Feb 22 03:55:29 katelyngigante bash[15835]:     await getattr(Commands, 'bug')(Commands, bot, message.channel, 'Command failed with {c}: {cmd}\n\n```\n{tb}\n```'.format(c=e.__class__.__name__, cmd=message.content, tb=tb), message.author)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 355, in bug
Feb 22 03:55:29 katelyngigante bash[15835]:     await bot.client.send_message(channel, "Issue has been reported at <{url}>".format(url=issue.html_url))
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 1152, in send_message
Feb 22 03:55:29 katelyngigante bash[15835]:     data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
Feb 22 03:55:29 katelyngigante bash[15835]:     r = yield from self.session.request(method, url, **kwargs)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
Feb 22 03:55:29 katelyngigante bash[15835]:     resp = yield from self._coro
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 202, in _request
Feb 22 03:55:29 katelyngigante bash[15835]:     yield from resp.start(conn, read_until_eof)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 640, in start
Feb 22 03:55:29 katelyngigante bash[15835]:     message = yield from httpstream.read()
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 641, in read
Feb 22 03:55:29 katelyngigante bash[15835]:     result = yield from super().read()
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 476, in read
Feb 22 03:55:29 katelyngigante bash[15835]:     yield from self._waiter
Feb 22 03:55:29 katelyngigante bash[15835]: aiohttp.errors.ClientRequestError: Can not write request body for https://discordapp.com/api/v6/channels/228838316907167745/messages
Feb 22 03:55:29 katelyngigante bash[15835]: Ignoring exception in on_message
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 200, in _request
Feb 22 03:55:29 katelyngigante bash[15835]:     resp = req.send(conn.writer, conn.reader)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 490, in send
Feb 22 03:55:29 katelyngigante bash[15835]:     writer.set_tcp_cork(True)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/parsers.py", line 274, in set_tcp_cork
Feb 22 03:55:29 katelyngigante bash[15835]:     False)
Feb 22 03:55:29 katelyngigante bash[15835]: OSError: [Errno 9] Bad file descriptor
Feb 22 03:55:29 katelyngigante bash[15835]: The above exception was the direct cause of the following exception:
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 66, in handle_command
Feb 22 03:55:29 katelyngigante bash[15835]:     await method(Commands, bot, message.channel, args, message.author)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 467, in art
Feb 22 03:55:29 katelyngigante bash[15835]:     await bot.send_image_with_retry(channel, image_file)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 101, in send_image_with_retry
Feb 22 03:55:29 katelyngigante bash[15835]:     message = await self.client.send_file(channel, image_file, content=text)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 1235, in send_file
Feb 22 03:55:29 katelyngigante bash[15835]:     filename=filename, content=content, tts=tts)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
Feb 22 03:55:29 katelyngigante bash[15835]:     r = yield from self.session.request(method, url, **kwargs)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
Feb 22 03:55:29 katelyngigante bash[15835]:     resp = yield from self._coro
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 211, in _request
Feb 22 03:55:29 katelyngigante bash[15835]:     raise aiohttp.ClientOSError(*exc.args) from exc
Feb 22 03:55:29 katelyngigante bash[15835]: aiohttp.errors.ClientOSError: [Errno 9] Bad file descriptor
Feb 22 03:55:29 katelyngigante bash[15835]: During handling of the above exception, another exception occurred:
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
Feb 22 03:55:29 katelyngigante bash[15835]:     yield from getattr(self, event)(*args, **kwargs)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 140, in on_message
Feb 22 03:55:29 katelyngigante bash[15835]:     await BOT.on_message(message)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 42, in on_message
Feb 22 03:55:29 katelyngigante bash[15835]:     await self.respond_to_command(message)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 59, in respond_to_command
Feb 22 03:55:29 katelyngigante bash[15835]:     await command.handle_command(message, self)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 78, in handle_command
Feb 22 03:55:29 katelyngigante bash[15835]:     print(tb)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/codecs.py", line 377, in write
Feb 22 03:55:29 katelyngigante bash[15835]:     self.stream.write(data)
Feb 22 03:55:29 katelyngigante bash[15835]: OSError: [Errno 9] Bad file descriptor
Feb 22 03:55:29 katelyngigante bash[15835]: Fatal write error on socket transport
Feb 22 03:55:29 katelyngigante bash[15835]: protocol: <asyncio.sslproto.SSLProtocol object at 0x7f89b984ba90>
Feb 22 03:55:29 katelyngigante bash[15835]: transport: <_SelectorSocketTransport fd=1 read=polling write=<idle, bufsize=0>>
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/asyncio/selector_events.py", line 761, in write
Feb 22 03:55:29 katelyngigante bash[15835]:     n = self._sock.send(data)
Feb 22 03:55:29 katelyngigante bash[15835]: OSError: [Errno 9] Bad file descriptor
Feb 22 03:55:29 katelyngigante bash[15835]: Unclosed connection
Feb 22 03:55:29 katelyngigante bash[15835]: client_connection: Connection<('discordapp.com', 443, True)>
Feb 22 03:55:29 katelyngigante bash[15835]: Exception in callback _SelectorTransport._call_connection_lost(OSError(9, 'B...e descriptor'))
Feb 22 03:55:29 katelyngigante bash[15835]: handle: <Handle _SelectorTransport._call_connection_lost(OSError(9, 'B...e descriptor'))>
Feb 22 03:55:29 katelyngigante bash[15835]: Traceback (most recent call last):
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/asyncio/events.py", line 145, in _run
Feb 22 03:55:29 katelyngigante bash[15835]:     self._callback(*self._args)
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/asyncio/selector_events.py", line 664, in _call_connection_lost
Feb 22 03:55:29 katelyngigante bash[15835]:     self._sock.close()
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/socket.py", line 417, in close
Feb 22 03:55:29 katelyngigante bash[15835]:     self._real_close()
Feb 22 03:55:29 katelyngigante bash[15835]:   File "/usr/lib64/python3.6/socket.py", line 411, in _real_close
Feb 22 03:55:29 katelyngigante bash[15835]:     _ss.close(self)
Feb 22 03:55:29 katelyngigante bash[15835]: OSError: [Errno 9] Bad file descriptor
bakert commented 6 years ago

Scryfall API as we call it works fine: https://api.scryfall.com/cards/named?exact=survive%20the%20night&format=image&version=art_crop

bakert commented 6 years ago

Fails for me from local on test server with the same error.

bakert commented 6 years ago
Traceback (most recent call last):
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 407, in write_bytes
    result = stream.send(value)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/helpers.py", line 191, in _gen_form_data
    yield from self._writer.serialize()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 969, in serialize
    yield from part.serialize()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 768, in serialize
    yield from self._maybe_encode_stream(self._serialize_obj())
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 781, in _serialize_obj
    return self._serialize_default(obj)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/multipart.py", line 813, in _serialize_default
    raise TypeError('unknown body part type %r' % type(obj))
TypeError: unknown body part type <class 'bool'>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 66, in handle_command
    await method(Commands, bot, message.channel, args, message.author)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 458, in art
    await bot.send_image_with_retry(channel, image_file)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/bot.py", line 110, in send_image_with_retry
    message = await self.client.send_file(channel, image_file, content=text)
  File "/home/discord/.local/lib/python3.6/site-packages/discord/client.py", line 1235, in send_file
    filename=filename, content=content, tts=tts)
  File "/home/discord/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
    r = yield from self.session.request(method, url, **kwargs)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
    resp = yield from self._coro
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client.py", line 202, in _request
    yield from resp.start(conn, read_until_eof)
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 640, in start
    message = yield from httpstream.read()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 641, in read
    result = yield from super().read()
  File "/home/discord/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 476, in read
    yield from self._waiter
aiohttp.errors.ClientRequestError: Can not write request body for https://discordapp.com/api/v6/channels/207281932214599682/messages
bakert commented 6 years ago
>>> magic.image_fetcher.download_scryfall_image([Container({ 'name': 'Survive the Night' })], filepath='/tmp/x.png', version='art_crop')
Trying to get scryfall image for Container({'name': 'Survive the Night'})
Storing https://api.scryfall.com/cards/named?exact=survive+the+night&format=image&version=art_crop in /tmp/x.png
True

Works fine.

The file is 87K.

bakert commented 6 years ago
Exception ignored in: <encodings.utf_8.StreamWriter object at 0x10ebbf0b8>
OSError: [Errno 9] Bad file descriptor

?

bakert commented 6 years ago

98d87a88 makes it so we don't try and use the boolean of "did download succeed" as the file path. Not sure what happened there.