[New-bugs-announce] [issue25320] unittest loader.py TypeError when code directory contains a socket

Victor van den Elzen report at bugs.python.org
Mon Oct 5 18:43:44 CEST 2015


New submission from Victor van den Elzen:

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".

----------
components: Library (Lib)
files: unittest_socket.diff
keywords: patch
messages: 252342
nosy: Victor van den Elzen
priority: normal
severity: normal
status: open
title: unittest loader.py TypeError when code directory contains a socket
versions: Python 3.5
Added file: http://bugs.python.org/file40690/unittest_socket.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25320>
_______________________________________


More information about the New-bugs-announce mailing list