msg252342 - (view) |
Author: Victor van den Elzen (Victor van den Elzen) * |
Date: 2015-10-05 16:43 |
Hi, when trying to run tests after upgrading from Python 3.4 to Python 3.5 I encountered the following exception: Traceback (most recent call last): ... File "/usr/lib/python3.5/unittest/loader.py", line 341, in discover tests = list(self._find_tests(start_dir, pattern)) File "/usr/lib/python3.5/unittest/loader.py", line 398, in _find_tests full_path, pattern, namespace) TypeError: 'NoneType' object is not iterable This was caused by a stray socket in my code directory, and the fact that _find_test_path only considers directories and regular files. I attached a suggested fix that just skips all special files. No tests other than "it works on my machine". |
|
|
msg252825 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-10-11 22:04 |
The fix is appropriate (we might want to think about symlinks in the future). I'd very much like a test for it (in Lib/unittest/test/test_discovery.py) and it should be applied to 3.5, master - older versions had this wrapped up in simpler code and won't fail like this. |
|
|
msg253249 - (view) |
Author: Victor van den Elzen (Victor van den Elzen) * |
Date: 2015-10-20 20:17 |
patch-with-test.patch is a patch against current tip (c3cec0f77eff+). It applies cleanly to 3.5. It seemed simplest to include the socket in test_find_tests. |
|
|
msg253250 - (view) |
Author: Victor van den Elzen (Victor van den Elzen) * |
Date: 2015-10-20 20:18 |
Alternatively, patch-with-seperate-test.patch creates a seperate function to test for this issue. |
|
|
msg255193 - (view) |
Author: Victor van den Elzen (Victor van den Elzen) * |
Date: 2015-11-23 16:55 |
Ping |
|
|
msg257263 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2016-01-01 02:13 |
The fix looks ok, however the test seem to contain unnecessary code and it duplicates most of the previous test. I left a more detailed review on rietveld (see the "review" link next to the patch). |
|
|
msg261790 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-03-15 00:32 |
New changeset efc9836e0c83 by Robert Collins in branch '3.5': #25320: Handle sockets in directories unittest discovery is scanning. https://hg.python.org/cpython/rev/efc9836e0c83 |
|
|
msg261791 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-03-15 00:33 |
New changeset 1d72402c1c91 by Robert Collins in branch 'default': #25320: Handle sockets in directories unittest discovery is scanning. https://hg.python.org/cpython/rev/1d72402c1c91 |
|
|
msg261792 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2016-03-15 00:37 |
Thanks for the patch; the test may be redundant but not enough to matter for now - and the bug really doth need fixing, so I've applied it as-is. |
|
|
msg263002 - (view) |
Author: Mike Miller (Mike Miller) |
Date: 2016-04-07 20:16 |
Just as a side note, the patch also works for soft links that point to files that don't exist. Thanks for getting this fixed! |
|
|