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
When I tried to open a ws throw briefcase it breaks, but the same code works perfectly.
It happens:
Exception in callback ReadTransport._loop_reading(<Future finis...\x00\x00\x00'>)
handle: <GLibHandle ReadTransport._loop_reading(<Future finis...\x00\x00\x00'>)>
Traceback (most recent call last):
File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/user/workspace/pychat/build/pychat/endeavouros/rolling/pychat-0.0.1/usr/lib/pychat/app_packages/gbulb/transports.py", line 177, in _loop_reading
self._submit_read_data(data)
File "/home/user/workspace/pychat/build/pychat/endeavouros/rolling/pychat-0.0.1/usr/lib/pychat/app_packages/gbulb/transports.py", line 127, in _submit_read_data
self._protocol.data_received(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SSLProtocol' object has no attribute 'data_received'
I have prepared a dummy demostration script for that reason:
import aiohttp
from aiohttp import ClientSession
import asyncio
url = "wss://demo.piesocket.com/v3/channel_123"
ws_headers = {
'Origin': 'https://www.piesocket.com',
'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits',
'Sec-WebSocket-Version': '13',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
'AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/90.0.4430.212 Safari/537.36',
}
async def run_init_conversation(prompt="hello world!", cookies = ''):
async with ClientSession(headers=ws_headers, cookies=cookies, timeout=aiohttp.ClientTimeout(total=60)) as session:
async with session.ws_connect(url, autoping=False, params={'api_key': "VCXCEuvhGcBDP7XhiJJUDvR1e1D3eiVjgZ9VRiaV"}) as wss:
print("Connected to test")
if __name__ == '__main__':
asyncio.run(run_init_conversation())
or simply add this code to a dummy Toga App:
self.add_background_task(self.background)
and the definitions:
def background(self, widget, **kwargs):
task = self.run_init_conversation()
asyncio.run_coroutine_threadsafe(task, self.loop)
async def run_init_conversation(self, prompt="hello world!", cookies = ''):
async with ClientSession(headers=ws_headers, cookies=cookies, timeout=aiohttp.ClientTimeout(total=60)) as session:
async with session.ws_connect(url, autoping=False, params={'api_key': "VCXCEuvhGcBDP7XhiJJUDvR1e1D3eiVjgZ9VRiaV"}) as wss:
print("Connected to test")
Steps to reproduce
briefcase build linux briefcase run linux
Execute the code attached
Expected behavior
in screen it should print Connected to test but weird exception appears
Screenshots
No response
Environment
Operating System: EndeavourOS & Gnome Shell
Python version: 3.11.6
Software versions:
Briefcase: 0.3.16
Toga: 0.4.1
Toga-Core: 0.4.1
aiohttp: 3.9.1
asyncio: 3.4.3
Logs
Exception in callback ReadTransport._loop_reading(<Future finis...xd3|\xbe\x05'>)
handle: <GLibHandle ReadTransport._loop_reading(<Future finis...xd3|\xbe\x05'>)>
Traceback (most recent call last):
File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/user/workspace/pychat/build/pychat/endeavouros/rolling/pychat-0.0.1/usr/lib/pychat/app_packages/gbulb/transports.py", line 177, in _loop_reading
self._submit_read_data(data)
File "/home/user/workspace/pychat/build/pychat/endeavouros/rolling/pychat-0.0.1/usr/lib/pychat/app_packages/gbulb/transports.py", line 127, in _submit_read_data
self._protocol.data_received(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SSLProtocol' object has no attribute 'data_received'
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When I tried to open a ws throw briefcase it breaks, but the same code works perfectly.
It happens:
I have prepared a dummy demostration script for that reason:
or simply add this code to a dummy Toga App:
self.add_background_task(self.background)
and the definitions:
Steps to reproduce
briefcase build linux
briefcase run linux
Execute the code attached
Expected behavior
in screen it should print
Connected to test
but weird exception appearsScreenshots
No response
Environment
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: