mwilliamson / spur.py

Run commands and manipulate files locally or over SSH using the same interface
BSD 2-Clause "Simplified" License
267 stars 37 forks source link

test failures with python 3.8 #85

Closed opoplawski closed 1 year ago

opoplawski commented 5 years ago
nosetests-3.8 -v -e testing -e ssh_tests
======================================================================
ERROR:
tests.local_tests.LocalProcessTests.spawning_command_that_uses_path_env_variable_asks_if_command_is_installed
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
24, in run_test
    test_func(shell)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
225, in
spawning_command_that_uses_path_env_variable_asks_if_command_is_installed
    shell.spawn(["i-am-not-a-command"])
  File "/builddir/build/BUILD/spur.py-0.3.21/spur/local.py", line 67, in spawn
    process = subprocess.Popen(
  File "/usr/lib64/python3.8/subprocess.py", line 830, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.8/subprocess.py", line 1648, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'i-am-not-a-command'

======================================================================
ERROR:
tests.local_tests.LocalProcessTests.spawning_non_existent_command_raises_specific_no_such_command_exception
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
24, in run_test
    test_func(shell)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
214, in spawning_non_existent_command_raises_specific_no_such_command_exception
    shell.spawn(["bin/i-am-not-a-command"])
  File "/builddir/build/BUILD/spur.py-0.3.21/spur/local.py", line 67, in spawn
    process = subprocess.Popen(
  File "/usr/lib64/python3.8/subprocess.py", line 830, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.8/subprocess.py", line 1648, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory:
'bin/i-am-not-a-command'

======================================================================
ERROR:
tests.local_tests.LocalProcessTests.using_non_existent_command_and_correct_cwd_raises_no_such_command_exception
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
24, in run_test
    test_func(shell)
  File "/builddir/build/BUILD/spur.py-0.3.21/tests/process_test_set.py", line
317, in
using_non_existent_command_and_correct_cwd_raises_no_such_command_exception
    shell.spawn(["bin/i-am-not-a-command"], cwd="/bin")
  File "/builddir/build/BUILD/spur.py-0.3.21/spur/local.py", line 67, in spawn
    process = subprocess.Popen(
  File "/usr/lib64/python3.8/subprocess.py", line 830, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.8/subprocess.py", line 1648, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory:
'bin/i-am-not-a-command'

Perhaps exception names have changed with python 3.8?

opoplawski commented 5 years ago

ping?

mgorny commented 4 years ago

This code is just horrible :-(. It seems to rely on internal fields of Python exceptions, and these changed in py3.8.

mwilliamson commented 1 year ago

Thanks for the report, this is now fixed in master.

opoplawski commented 1 year ago

Looks good. Thank you for the fix.