This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author roysmith
Recipients roysmith
Date 2010-11-20.20:54:12
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1290286456.52.0.376414349457.issue10473@psf.upfronthosting.co.za>
In-reply-to
Content
While investigating issue7322, I wrote a test case to demonstrate the issue.  I made a mistake and called settimeout() on the wrong socket, but the result appears to demonstrate a different bug.  When I run the attached test-issue7322.py on my OSX-10.6.5 machine, using...

Python 3.2a4+ (py3k:86538, Nov 19 2010, 20:52:31) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin

I get the output below.  The bug is that readline() is returning, even though I never wrote a newline on the other side of the connection.  If I comment out the settimeout() call, it hangs in the readline() call, as expected.

While I admit it makes no sense to call settimeout() on the listening socket, doing so certainly should not cause this behavior.

Note: I also tried this on Ubuntu linux (with python built from the same 3.2a4+ sources).  I cannot reproduce the problem there.


issue7322$ ./test-issue7322.py 
F/Users/roy/python/py3k/Lib/unittest/case.py:382: ResourceWarning: unclosed <socket.socket object, fd=3, family=2, type=1, proto=0>
  result.addFailure(self, sys.exc_info())
/Users/roy/python/py3k/Lib/unittest/case.py:382: ResourceWarning: unclosed <socket.socket object, fd=4, family=2, type=1, proto=0>
  result.addFailure(self, sys.exc_info())
/Users/roy/python/py3k/Lib/socket.py:324: ResourceWarning: unclosed <socket.socket object, fd=5, family=2, type=1, proto=0>
  self._sock = None

======================================================================
FAIL: test_foo (__main__.Test_Issue7322)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test-issue7322.py", line 22, in test_foo
    self.fail("readline() returned '%s'" % line)
AssertionError: readline() returned 'hello'

----------------------------------------------------------------------
Ran 1 test in 0.026s

FAILED (failures=1)
[49547 refs]
History
Date User Action Args
2010-11-20 20:54:16roysmithsetrecipients: + roysmith
2010-11-20 20:54:16roysmithsetmessageid: <1290286456.52.0.376414349457.issue10473@psf.upfronthosting.co.za>
2010-11-20 20:54:12roysmithlinkissue10473 messages
2010-11-20 20:54:12roysmithcreate