diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 2048cf563..cb178bb24 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -74,7 +74,10 @@ class LsofFdLeakChecker(object): def matching_platform(self): try: py.process.cmdexec("lsof -v") - except py.process.cmdexec.Error: + except (py.process.cmdexec.Error, UnicodeDecodeError): + # cmdexec may raise UnicodeDecodeError on Windows systems + # with locale other than english: + # https://bitbucket.org/pytest-dev/py/issues/66 return False else: return True diff --git a/testing/test_capture.py b/testing/test_capture.py index 2b1fc69c8..b20961c03 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -650,7 +650,7 @@ def lsof_check(): try: out = py.process.cmdexec("lsof -p %d" % pid) except (py.process.cmdexec.Error, UnicodeDecodeError): - # about UnicodeDecodeError, see note on conftest.py + # about UnicodeDecodeError, see note on pytester pytest.skip("could not run 'lsof'") yield out2 = py.process.cmdexec("lsof -p %d" % pid)