PySimpleGUI / PySimpleGUI/PySimpleGUI

[ Bug] Some occasional exception - apparently handled, but then the webpage stops working

オープン
#3,629 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
13.8k
フォーク
1.8k
PR マージ指標
30日以内にマージされた PR はありません

説明

Type of Issues (Enhancement, Error, Bug, Question)

Bug

Operating System

Linux

Python version

3.7.8

PySimpleGUI Port and Version
<module 'PySimpleGUIWeb' from '/home/pi/.local/lib/python3.7/site-packages/PySimpleGUIWeb/__init__.py'>

>>> print(sg.version)     # PySimpleGUI version number
0.39.0  Released 6-Jun-2020

>>> print(sg.tclversion_detailed)   # tkinter detailed version number (in PySimpleGUI version 4.29.0+)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'PySimpleGUIWeb' has no attribute 'tclversion_detailed'

>>> print(sg.sys.version) # Python version number
3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0]

Your Experience Levels In Months or Years

2_________ Python programming experience

30_________ Programming experience overall
no_________ Have used another Python GUI Framework (tkinter, Qt, etc) previously (yes/no is fine)?

You have completed these steps:
  • Read instructions on how to file an Issue
  • Searched through main docs http://www.PySimpleGUI.org for your problem
  • Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
  • Note that there are also Demo Programs under each port on GitHub
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported
  • Try again by upgrading your PySimpleGUI.py file to use the current one on GitHub. Your problem may have already been fixed but is not yet on PyPI.
Description of Problem / Question / Details

after some time, processing some button clicks (as simple as if pressed, increase an integer.)
this can spawn on the console as web page stops working:

----------------------------------------
Exception happened during processing of request from ('192.168.1.41', 58336)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/pi/.local/lib/python3.7/site-packages/PySimpleGUIWeb/PySimpleGUIWeb.py", line 3360, in __init__
    super(Window.MyApp, self).__init__(*args,  static_file_path={'C':'c:','c':'c:','D':'d:', 'd':'d:', 'E':'e:', 'e':'e:', 'dot':'.', '.':'.'})
  File "/home/pi/.local/lib/python3.7/site-packages/remi/server.py", line 313, in __init__
    super(App, self).__init__(request, client_address, server)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "/home/pi/.local/lib/python3.7/site-packages/remi/server.py", line 566, in do_GET
    ws = WebSocketsHandler(self.headers, self.request, self.client_address, self.server)
  File "/home/pi/.local/lib/python3.7/site-packages/remi/server.py", line 129, in __init__
    socketserver.StreamRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/home/pi/.local/lib/python3.7/site-packages/remi/server.py", line 145, in handle
    clients[self.session].websockets.remove(self)
ValueError: list.remove(x): x not in list
----------------------------------------
Saved:  Normal
Saved:  Normal
----------------------------------------
Exception happened during processing of request from ('192.168.1.41', 58454)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/pi/.local/lib/python3.7/site-packages/PySimpleGUIWeb/PySimpleGUIWeb.py", line 3360, in __init__
    super(Window.MyApp, self).__init__(*args,  static_file_path={'C':'c:','c':'c:','D':'d:', 'd':'d:', 'E':'e:', 'e':'e:', 'dot':'.', '.':'.'})
  File "/home/pi/.local/lib/python3.7/site-packages/remi/server.py", line 313, in __init__
    super(App, self).__init__(request, client_address, server)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 394, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer
----------------------------------------


Code To Duplicate

I cannot think of how to narrow it down, as I do not see any meaningful order of operatoin that causes this.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

PySimpleGUIWeb.py の 3360 行付近と、remi/server.py の対応するリクエスト処理から始めてください。特に、145 行付近の websocket のクリーンアップと、566 行付近の do_GET を確認してください。可能であれば、断続的に発生する list.remove と connection-reset の失敗を再現し、その後、リクエストエラーの後も Web ページが引き続き使用可能であることを確認する回帰テストを定義してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
frontend, web-dev
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。