[issue25095] test_httpservers hangs on 3.5.0, win 7

2018-01-04 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for tracking down the problem, William! I just took a quick look at 
your patch and it seems reasonable to me.

Setting protocol_version to 'HTTP/1.1' means setting the close_connection 
attribute of BaseHTTPRequestHandler to False which is expected and a feature of 
HTTP/1.1 (persistent connections)

Quoting RFC 2616:

HTTP/1.1 defines the "close" connection option for the sender to
signal that the connection will be closed after completion of the
response.

HTTP/1.1 applications that do not support persistent connections MUST
include the "close" connection option in every message.

So I think it's OK to send a "Connection: close" header in the test (it would 
be nice to add a comment though)

--
components:  -Library (Lib)
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2018-01-04 Thread William Pickard

Change by William Pickard :


--
keywords: +patch
pull_requests: +4969
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2018-01-04 Thread William Pickard

William Pickard  added the comment:

Scratch the previous message about the possible cause, I found the true cause, 
getresponse() is waiting for a specific header, one that 
BaseHTTPRequestHandler.send_error sends and 
BaseHTTPRequestHandler.send_response() doesn't, that header is "Connection" 
with message "close" (http.server#450), adding that to 
RequestHandlerLoggingTestCase.request_handler.do_GET before self.end_headers() 
fixes the deadlock.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2018-01-04 Thread WildCard65

WildCard65  added the comment:

I believe I found the issue, might be an issue between sending the request + 
calling get_response() and the time it takes for server to process response, my 
print cases:

test_err (test.test_httpservers.RequestHandlerLoggingTestCase) ... Creating a 
new connection to 127.0.0.1:50141
Connecting to server
Sending ERROR request, captured stderr instance is <_io.StringIO object at 
0x05E5EC00>
HANDLING AN ERROR REQUEST! SENDING RESPONSE!
Request sent, starting to read response

RESPONSE SENT!
Response obtained, err should be set, <_io.StringIO object at 0x05E5EC00>
Running test's assert
ok
test_get (test.test_httpservers.RequestHandlerLoggingTestCase) ... Creating a 
new connection to 127.0.0.1:50143
Connecting to server
Sending GET request, captured stderr instance is <_io.StringIO object at 
0x05E5EC00>
Request sent, starting to read response
HANDLING A GET REQUEST! SENDING RESPONSE!
RESPONSE SENT! ENDING HEADERS!
HEADERS ENDED!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2018-01-04 Thread WildCard65

WildCard65  added the comment:

Adding onto this issue, I believe I tracked down the change that caused the 
issue: 
https://github.com/python/cpython/commit/c0a23e63207984304027f298eefc738b6b3c94b1

This issue also affects the test with Python 3.6

--
nosy: +WildCard65

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-16 Thread Martin Panter

Martin Panter added the comment:

According to those back traces, the server has apparently already handled one 
request and is waiting for a second request. However the client is still 
waiting for a response from its original request.

Some things I might try would be to disable the server, and make my own dummy 
server to see if it responds to that. Similarly, disable the client and 
manually make a request to the server and see what the response is. On Linux 
the “socat” or “netcat” programs are useful for this stuff, or you can just use 
the Python interactive interpreter to create a socket and send and receive.

Client connection is made at 
. 
Server is constructed at 
.

You could also try adding self.con.set_debuglevel(99) to the test_get() method, 
though I suspect it will just output the request sent, and not report any reply 
or headers. In my case the test works, and I see:

send: b'GET / HTTP/1.1\r\nHost: 127.0.0.1:48059\r\nAccept-Encoding: 
identity\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
[Unit test output]
header: Server header: Date $

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-16 Thread STINNER Victor

STINNER Victor added the comment:

You may try "hg bisect" to find which revision broke test_httpservers. It can 
be slow if you have to recompile manually Python :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

test_get (test.test_httpservers.RequestHandlerLoggingTestCase) ...
same on repeat

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-15 Thread STINNER Victor

STINNER Victor added the comment:

Where does it hang? For example, try to run the test using:

python.exe -m test -v --timeout=10 test_httpservers

Can it be a firewall or antivirus issue?

Try to add some print() in TestServerThread.run() to check if the HTTP server 
is running or not.

--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

test_get (test.test_httpservers.RequestHandlerLoggingTestCase) ... Timeout 
(0:00:10)!
Thread 0x1654 (most recent call first):
  File "C:\Programs\Python35\lib\socket.py", line 571 in readinto
  File "C:\Programs\Python35\lib\http\server.py", line 383 in handle_one_request
  File "C:\Programs\Python35\lib\http\server.py", line 417 in handle
  File "C:\Programs\Python35\lib\socketserver.py", line 684 in __init__
  File "C:\Programs\Python35\lib\socketserver.py", line 357 in finish_request
  File "C:\Programs\Python35\lib\socketserver.py", line 344 in process_request
  File "C:\Programs\Python35\lib\socketserver.py", line 318 in 
_handle_request_noblock
  File "C:\Programs\Python35\lib\socketserver.py", line 239 in serve_forever
  File "C:\Programs\Python35\lib\test\test_httpservers.py", line 47 in run
  File "C:\Programs\Python35\lib\threading.py", line 923 in _bootstrap_inner
  File "C:\Programs\Python35\lib\threading.py", line 891 in _bootstrap

Thread 0x17f8 (most recent call first):
  File "C:\Programs\Python35\lib\socket.py", line 571 in readinto
  File "C:\Programs\Python35\lib\http\client.py", line 243 in _read_status
  File "C:\Programs\Python35\lib\http\client.py", line 282 in begin
  File "C:\Programs\Python35\lib\http\client.py", line 1174 in getresponse
  File "C:\Programs\Python35\lib\test\test_httpservers.py", line 257 in test_get
  File "C:\Programs\Python35\lib\unittest\case.py", line 597 in run
  File "C:\Programs\Python35\lib\unittest\case.py", line 645 in __call__
  File "C:\Programs\Python35\lib\unittest\suite.py", line 122 in run
  File "C:\Programs\Python35\lib\unittest\suite.py", line 84 in __call__
  File "C:\Programs\Python35\lib\unittest\suite.py", line 122 in run
  File "C:\Programs\Python35\lib\unittest\suite.py", line 84 in __call__
  File "C:\Programs\Python35\lib\unittest\runner.py", line 176 in run
  File "C:\Programs\Python35\lib\test\support\__init__.py", line 1775 in 
_run_suite
  File "C:\Programs\Python35\lib\test\support\__init__.py", line 1809 in 
run_unittest
  File "C:\Programs\Python35\lib\test\test_httpservers.py", line 890 in 
test_main
  File "C:\Programs\Python35\lib\test\regrtest.py", line 1281 in runtest_inner
  File "C:\Programs\Python35\lib\test\regrtest.py", line 979 in runtest
  File "C:\Programs\Python35\lib\test\regrtest.py", line 763 in main
  File "C:\Programs\Python35\lib\test\regrtest.py", line 1565 in 
main_in_temp_cwd
  File "C:\Programs\Python35\lib\test\__main__.py", line 3 in 
  File "C:\Programs\Python35\lib\runpy.py", line 85 in _run_code
  File "C:\Programs\Python35\lib\runpy.py", line 170 in _run_module_as_main

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-14 Thread Martin Panter

Martin Panter added the comment:

Can you identify which test case hangs? E.g. on Linux I can run the following 
to see each test case run:

./python -m unittest -v test.test_httpservers

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

test_httpservers ok on 3.4.3, hangs indefinitely (over an hour) on 3.5.0, win 7.

--
components: Library (Lib), Tests, Windows
messages: 250606
nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_httpservers hangs on 3.5.0, win 7
type: crash
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com