classification
Title: test_xmlrpc: global name 'stop_serving' is not defined
Type: behavior Stage: needs patch
Components: Tests Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: krisvale Nosy List: akuchling, christian.heimes, dstanek, krisvale, pitrou, r.david.murray
Priority: high Keywords:

Created on 2009-10-10 20:39 by pitrou, last changed 2011-02-04 03:47 by belopolsky.

Messages (4)
msg93843 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-10-10 20:39
This happens at least on the py3k branch, I haven't checked other branches.


test test_xmlrpc failed -- Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
344, in tearDown
    stop_serving()
NameError: global name 'stop_serving' is not defined

1 test failed:
    test_xmlrpc
Unhandled exception in thread started by <bound method Thread._bootstrap
of <Thread(Thread-13, started 140424593951056)>>
Error in sys.excepthook:
TypeError: 'NoneType' object is not callable

Original exception was:
Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
282, in _handle_request_noblock
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
308, in process_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
321, in finish_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
639, in __init__
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
693, in finish
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 242, in close
AttributeError: 'NoneType' object has no attribute 'RawIOBase'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
294, in http_server
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
267, in handle_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
284, in _handle_request_noblock
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
340, in handle_error
ImportError: No module named traceback

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
297, in http_server
AttributeError: 'NoneType' object has no attribute 'timeout'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 509,
in _bootstrap_inner
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 462,
in run
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
300, in http_server
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 178, in close
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 173, in
_real_close
AttributeError: 'NoneType' object has no attribute 'socket'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 527,
in _bootstrap_inner
AttributeError: 'Thread' object has no attribute '_exc_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 482,
in _bootstrap
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 557,
in _bootstrap_inner
AttributeError: __exit__
[101191 refs]

1 test failed:
    test_xmlrpc
Unhandled exception in thread started by <bound method Thread._bootstrap
of <Thread(Thread-13, started 140014861584720)>>
Error in sys.excepthook:
TypeError: 'NoneType' object is not callable

Original exception was:
Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
282, in _handle_request_noblock
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
308, in process_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
321, in finish_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
639, in __init__
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
693, in finish
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 242, in close
AttributeError: 'NoneType' object has no attribute 'RawIOBase'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
294, in http_server
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
267, in handle_request
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
284, in _handle_request_noblock
  File "/home/antoine/py3k/bz-multistream/Lib/socketserver.py", line
340, in handle_error
ImportError: No module named traceback

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
297, in http_server
AttributeError: 'NoneType' object has no attribute 'timeout'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 509,
in _bootstrap_inner
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 462,
in run
  File "/home/antoine/py3k/bz-multistream/Lib/test/test_xmlrpc.py", line
300, in http_server
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 178, in close
  File "/home/antoine/py3k/bz-multistream/Lib/socket.py", line 173, in
_real_close
AttributeError: 'NoneType' object has no attribute 'socket'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 527,
in _bootstrap_inner
AttributeError: 'Thread' object has no attribute '_exc_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 482,
in _bootstrap
  File "/home/antoine/py3k/bz-multistream/Lib/threading.py", line 557,
in _bootstrap_inner
AttributeError: __exit__
[101191 refs]
msg93853 - (view) Author: Kristján Valur Jónsson (krisvale) * Date: 2009-10-11 11:58
I can't repro on my windows box.
From what I can see, for some reason the server thread isn't 
terminating, so we enter an errorhandling codepath that is broken.
The slew of errors that follow occur when the process is exiting and the 
worker threads have had the carpet pulled from underneath them, as it 
were.

We should remove the "stop_serving()" call, it is some rudiment of 
ancient code.  But the real error is still hidden, whatever caused the 
server to not exit.  If this is easily repro, maybe you can produce a 
traceback of the worker thread at this point?
msg100170 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2010-02-26 20:22
The stop_serving() code was only added on the Py3k branch
in rev59424.  It was removed in rev60350,
which is a merge commit; the diff is http://svn.python.org/view/python/branches/py3k/Lib/test/test_xmlrpc.py?r1=60094&r2=60350.

I don't know if this is a merging error, or if the 2.x changes mean stop_serving() is no longer required. Christian Heimes was responsible for both originally adding stop_serving() and for the merge that removed it. Adding him to the nosy list.
msg100172 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-02-26 20:29
Having looked at this code for another reason, I suspect that the stop_serving change was an attempt to handle a possible hang in the test, and that the py2 code simply doesn't try to handle that possible hang.  Note that you can simulate the hang by having a test method never issue a request.  I couldn't figure out a way to get the server to stop serving, but I didn't try for too long before I gave up and used a different solution to the problem I was facing (skipping one of the tests...)
History
Date User Action Args
2011-02-04 03:47:41belopolskysetnosy: akuchling, pitrou, krisvale, dstanek, christian.heimes, r.david.murray
type: crash -> behavior
2011-01-26 17:57:42dstaneksetnosy: + dstanek
2010-02-26 20:29:09r.david.murraysetnosy: + r.david.murray
messages: + msg100172
2010-02-26 20:22:22akuchlingsetnosy: + christian.heimes, akuchling
messages: + msg100170
2009-10-11 11:58:23krisvalesetmessages: + msg93853
2009-10-10 20:39:29pitroucreate