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

Error : Web push send from python backend to fire base using VAPI keys. Unhashable type:'slice'

Aperta
#145 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
angular, firebase, flask, gcp, python
Ambito
backend, cloud

Direzione di ricerca

Start at /app/main.py line 428 and inspect the types and contents of subsObject and notificationMessageObject passed to pywebpush.webpush. Trace the call through pywebpush/init.py and http_ece/init.py around the reported encrypt failure, then verify that the Flask route can send a push without the unhashable slice error.

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

Descrizione

I have trouble getting pywebpush work for my python backend on gcp.

VAPI PUBLIC KEY and PVT KEY obtained from firebase dash board thourhg manual creation

#subscriptionObject comes from Angular front end. It used the VAPI PUBLIC KEY to receive the object.
I used the package versions specified in requirement.txt.
The call happens from a Flask app route.

webpush(subscription_info = subscriptionObject, data=notificationMessageObject, vapid_private_key=VAPID_PRIVATE_KEY, vapid_claims={"sub": "mailto:[email protected]"})
Error
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/site-packages/flask_cors/extension.py", line 110, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/app/main.py", line 428, in notify_one_device webpush(subscription_info = subsObject, data=notificationMessageObject, vapid_private_key=VAPID_PRIVATE_KEY, vapid_claims={"sub": "mailto:[email protected]"}) File "/usr/local/lib/python3.7/site-packages/pywebpush/init.py", line 485, in webpush timeout=timeout, File "/usr/local/lib/python3.7/site-packages/pywebpush/init.py", line 305, in send encoded = self.encode(data, content_encoding) File "/usr/local/lib/python3.7/site-packages/pywebpush/init.py", line 219, in encode version=content_encoding) File "/usr/local/lib/python3.7/site-packages/http_ece/init.py", line 394, in encrypt content[i:i + chunk_size], TypeError: unhashable type: 'slice'

Please guide how I should approach this.

Lingua principale
Python
Stelle
379
Fork
61
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 web-push-libs/pywebpush

Tutte le issue di web-push-libs/pywebpush

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.