Redirect stdout failing due to ls

I’m stuck on Stage #JV1. Using Python

My code current finds the stdout file that is being requested. I then use shutil.which to find if the file exists, if it doesn’t I create it. The issue I am running into is the test. One of the test is $ ls /tmp/baz > /tmp/foo/baz.md, but I feel like because technically ls has not be implemented my system is throwing the command not found code since it is not a shell command that has been implemented yet.

Here are my logs:

[your-program] $ ls -1 /tmp/fox > /tmp/cow/ant.md
[your-program] ls -1 /tmp/fox > /tmp/cow/ant.md: command not found
[tester::#JV1] ^ Expected prompt ("$ ") but received "ls -1 /tmp/fox > /tmp/cow/ant.md: command not found"
[your-program] $
[tester::#JV1] Test failed

@Linkstus I tried running your code against the previous stages, but it’s actually no longer passing a previous stage #IP1 (Run a program).

Suggestions:

  1. Use our CLI to test against previous stages by running:
codecrafters test --previous
  1. Focus on fixing the early stages first, as later stages depend on them.