FreeSimpleGUIWeb should allow newer remi version

Aperta Adatta ai principianti
#86 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Individua la dichiarazione della dipendenza di FreeSimpleGUIWeb che blocca remi e verifica come viene installato il pacchetto. Testa la versione più recente di remi con Python 3.10, incluso l'avvio di una GUI web e la conferma che la pagina venga caricata senza l'errore di connessione segnalato; l'attività è completata quando la dipendenza consente di usare la versione funzionante senza un monkeypatch.

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

Descrizione

I had a problem when installing FreeSimpleGUIWeb on Python 3.10... The remi version is bound to be <=2020.3.10, but there is a slightly newer version available 2022.7.27, which I am not sure of but I guess should work...

The problem at hand was as follows:

remi version 2020.3.10 has a bug, where it could not be loaded with python version >=3.4 (the catch phrase uses the wrong Exception in gui.py)

try:
    # Python 2.6-2.7
    from HTMLParser import HTMLParser
    h = HTMLParser()
    unescape = h.unescape
except ImportError:
    # Python 3
    try:
        from html.parser import HTMLParser
        h = HTMLParser()
        unescape = h.unescape
    except ImportError:
        # Python 3.4+
        import html
        unescape = html.unescape

The second ImportError does not catch the correct error as h.unescape is wrong not the import to HTMLParser.

So I tried to update the library (which does not work as my dependency manager states is must be <=2020.3.10). And afterwards I tried to monkeypatch the error away with:

from unittest.mock import patch
import sys
with patch.dict(sys.modules, {"html.parser":None}):
    import FreeSimpleGUI as sg

But this led to a situation, where script runs as expected, but the website isn't shown and results in a connection error...

So I updated remi to 2022.7.10 (ignoring the dependency manager) and voila it works (even without the monkeypatch)

So I have not thoroughly tested it, but I think the newer version should not break things for FreeSimpleGUIWeb and would allow to install and use it on newer python versions without dirty hacks.

Lingua principale
Python
Stelle
867
Fork
106
Merge medio
1m
PR unite (30g)
2

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 spyoungtech/FreeSimpleGUI

Tutte le issue di spyoungtech/FreeSimpleGUI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.