You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- I have updated to the latest version of mystbin.py.
- I have searched the issues for duplicates.
- I have provided the entire traceback, if applicable.
Describe the bug
Unable to post to the Mystbin API
To Reproduce
importmystbinmystbin_client=mystbin.Client()
a_string="Here is an example"mystbin_url=awaitmystbin_client.post(a_string, syntax=text) # Errors here on 2.1.0, no errors on 2.0.2print(mystbin_url)
Expected behavior
Should print the URL retrieved from mystbin to the console
Additional context
This only errors on 2.1.0, downgrading to 2.0.2 (which is what I've done) does not error.
Reading through the latest commit (fdef2fd), lines 70-94 were deleted and not replaced in client.py, this is what is causing this error
Relevant Traceback (v2.1.0):
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/discord/client.py", line 348, in _run_event
await self.on_error(event_name, *args, **kwargs)
File "/home/pi/Desktop/CBDiscordBot/main.py", line 59, in on_error
error_mb = await mystbin_client.post(tb, syntax="text")
File "/home/pi/.local/lib/python3.9/site-packages/mystbin/client.py", line 107, in _perform_async_post
self.session = await self._generate_async_session()
AttributeError: 'HTTPClient' object has no attribute '_generate_async_session'
The text was updated successfully, but these errors were encountered:
Extension: the latest update (2.1.2) fixed the error when doing asynchronous functions with mystbin, but with a synchronous session, an error still occurs.
Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mystbin
>>> import requests
>>> mb_client = mystbin.Client(session=requests.Session())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\creep\AppData\Local\Programs\Python\Python39\lib\site-packages\mystbin\client.py", line 67, in __init__
self._generate_sync_session(session) if not self._are_we_async else session
AttributeError: 'HTTPClient' object has no attribute '_generate_sync_session'
>>>
Describe the bug
Unable to post to the Mystbin API
To Reproduce
Expected behavior
Should print the URL retrieved from mystbin to the console
Additional context
This only errors on 2.1.0, downgrading to 2.0.2 (which is what I've done) does not error.
Reading through the latest commit (fdef2fd), lines 70-94 were deleted and not replaced in client.py, this is what is causing this error
Relevant Traceback (v2.1.0):
The text was updated successfully, but these errors were encountered: