質問編集履歴

4

pythonのソースを修正

2021/11/18 14:37

投稿

syoshinsya-
syoshinsya-

スコア21

test CHANGED
File without changes
test CHANGED
@@ -44,9 +44,7 @@
44
44
 
45
45
  sys.stdout = TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
46
46
 
47
- print("Content-Type: text/html;")
47
+ print("Content-Type: text/html;charset=UTF-8\n")
48
-
49
- print("charset=UTF-8\n")
50
48
 
51
49
  print()
52
50
 

3

pythonのソースを修正

2021/11/18 14:37

投稿

syoshinsya-
syoshinsya-

スコア21

test CHANGED
File without changes
test CHANGED
@@ -36,6 +36,12 @@
36
36
 
37
37
  # 表示させるページ
38
38
 
39
+ import sys
40
+
41
+ from io import TextIOWrapper
42
+
43
+
44
+
39
45
  sys.stdout = TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
40
46
 
41
47
  print("Content-Type: text/html;")
@@ -65,6 +71,8 @@
65
71
  "</body>"
66
72
 
67
73
  "</html>")
74
+
75
+
68
76
 
69
77
  ```
70
78
 

2

補足に記述したブラウザの挙動の表現とサーバーログの追加

2021/11/18 11:41

投稿

syoshinsya-
syoshinsya-

スコア21

test CHANGED
File without changes
test CHANGED
@@ -100,10 +100,66 @@
100
100
 
101
101
  # 補足
102
102
 
103
- - リストChromeでアクセスした後にEdgeでURLをたたいても読み込みが続いて真っ白になってしまうが、
103
+ - リストChromeでアクセスした後にEdgeでURLをたたいても読み込みが続いてページの更新がされない状態になってしまうが、
104
104
 
105
105
  読み込み中にChromeの方を再読み込みするとEdgeも表示される
106
106
 
107
107
  - リスト読み込みが続いているときはサーバーのログに何もないことからそもそもローカルサーバーにアクセスできていない気がする
108
108
 
109
109
  - アクセスする順番がChrome→Edgeの場合はEdgeはが、Edge→Chromeの場合はChromeが表示できなくなる
110
+
111
+ - 読み込みの途中で正常な方のブラウザで再読み込みすると以下のエラーがサーバーログに流れた後に両方のブラウザでページが表示される
112
+
113
+ ```log
114
+
115
+ ----------------------------------------
116
+
117
+ Exception happened during processing of request from ('127.0.0.1', 58386)
118
+
119
+ Traceback (most recent call last):
120
+
121
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 316, in _handle_request_noblock
122
+
123
+ self.process_request(request, client_address)
124
+
125
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 347, in process_request
126
+
127
+ self.finish_request(request, client_address)
128
+
129
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 360, in finish_request
130
+
131
+ self.RequestHandlerClass(request, client_address, self)
132
+
133
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 647, in __init__
134
+
135
+ super().__init__(*args, **kwargs)
136
+
137
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 720, in __init__
138
+
139
+ self.handle()
140
+
141
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 427, in handle
142
+
143
+ self.handle_one_request()
144
+
145
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 415, in handle_one_request
146
+
147
+ method()
148
+
149
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 651, in do_GET
150
+
151
+ f = self.send_head()
152
+
153
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 997, in send_head
154
+
155
+ return self.run_cgi()
156
+
157
+ File "C:\Users***\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 1213, in run_cgi
158
+
159
+ if not self.rfile._sock.recv(1):
160
+
161
+ ConnectionAbortedError: [WinError 10053] 確立された接続がホスト コンピューターのソウトウェアによって中止されました。
162
+
163
+ ----------------------------------------
164
+
165
+ ```

1

補足の追加

2021/11/18 06:52

投稿

syoshinsya-
syoshinsya-

スコア21

test CHANGED
File without changes
test CHANGED
@@ -95,3 +95,15 @@
95
95
  ```
96
96
 
97
97
  ChromeでアクセスしたログだけがあってEdgeでアクセスできていない...
98
+
99
+
100
+
101
+ # 補足
102
+
103
+ - リストChromeでアクセスした後にEdgeでURLをたたいても読み込みが続いて真っ白になってしまうが、
104
+
105
+ 読み込み中にChromeの方を再読み込みするとEdgeも表示される
106
+
107
+ - リスト読み込みが続いているときはサーバーのログに何もないことからそもそもローカルサーバーにアクセスできていない気がする
108
+
109
+ - アクセスする順番がChrome→Edgeの場合はEdgeはが、Edge→Chromeの場合はChromeが表示できなくなる