Skip to content

Retry After is broken #853

@tigrontools

Description

@tigrontools

Summary

retry_after headers convertion to float fail

Reproduction Steps

File "/home/poncho/Documents/autochatter_backend_testing/discord/abc.py", line 2005, in send
STDERR: data = await state.http.send_message(channel.id, params=params)
STDERR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
STDERR: File "/home/poncho/Documents/autochatter_backend_testing/discord/http.py", line 968, in request
STDERR: retry_after: float = data.get('retry_after', float(response.headers.get('Retry-After', 0)))
STDERR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
STDERR: ValueError: could not convert string to float: '2814, 2'

Code

just channel.send triggers that issue when ur under ratelimit

Expected Results

it should be able to convert the float and wait for the retry

Actual Results

there is an issue with converting the header to float "could not convert string to float: '2814, 2'"

System Information

I cloned current rep

Checklist

  • I have confirmed I am using unmodified discord.py-self and not the upstream discord.py.
  • I am using a user token (and it isn't visible in the code).
  • I have searched the open issues for duplicates.
  • I have searched closed issues for resolved duplicates.
  • I have confirmed the development version doesn't resolve the issue.
  • I have shared the entire traceback.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions