Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Error in handling protocol

Aperta
#228 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
networking

Direzione di ricerca

Read ws4py/client/init.py around lines 312-316 and inspect test_client.py, then reproduce a handshake containing Sec-WebSocket-Protocol with a bytes value. Add coverage for the protocol-handling failure and confirm the handshake completes without the reported TypeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

https://github.com/Lawouach/WebSocket-for-Python/blob/7f43f2a6bff1aabafad023652042439d7b9b8d84/ws4py/client/__init__.py#L312-L316

The value will be b'chat' if using same handshake information like the one on wiki.
So using join will result in TypeError: sequence item 0: expected str instance, int found.
I notice this code haven't been changed for 5 years. And I try to find an example of cherrypy and ws4py which contain a setting of Sec-WebSocket-Protocol for websocket server. But I can't find any. I also check the handshake information sent by simple example, and it didn't contain a Sec-WebSocket-Protocol header.
A more astonishing thing is there is no test about Sec-WebSocket-Protocol in test_client.py.

Lingua principale
Python
Stelle
1.1k
Fork
284
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Lawouach/WebSocket-for-Python

Tutte le issue di Lawouach/WebSocket-for-Python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.