Pipex: too many values to unpack (expect 2) and here doc missing
nwum opened this issue · 1 comments
Hello,
I've been getting this error which seems to come from the pipex' Fsoares.py compare output function:
def compare_output(self, test, native: CompletedProcess, native_outfile, pipex, pipex_outfile):
def diff_stderr(stderr, actual_stderr):
errs = sorted(stderr.lower().splitlines())
actual_errs = stderr.lower().splitlines()
for line in errs:
split = line.split(":")
if len(split) < 3:
continue
cmd, msg = map(str.strip, split[1:]) <~~~~~~~~~~~~~~~~~ HERE
line = next(filter(lambda line: cmd in line, actual_errs), None)
if line is None:
return True
if msg not in line:
return True
return False
problems = []
if diff_stderr(native.stderr, pipex.stderr):
problems.append(
["stderr\nNeeds to have the same message\nand command/filename", native.stderr, pipex.stderr])
if native.returncode != pipex.returncode != 0:
problems.append(["return code", str(native.returncode), str(pipex.returncode)])
if native_outfile != pipex_outfile:
problems.append(["outfile content", native_outfile, pipex_outfile])
return [test, problems]
Additionally, it seems that the here_doc the tester uses isn't created when the francinette is running. I say this because I'm getting missing file error in my logs and after printing the temp directory at run time, there are just no here_doc to be found.
Hey, This is a problem on my side that I'm expecting a string with something like: "pipex: command not found: blabla"
This is actually not really needed, but I'm not taking it into account.
To correct it, could you send me examples of errors written by your program? (like when a command is not available, or a file is not there, or a file has no write access, etc)
About the heredoc, I don't create any file, I pass the input on stdin
to the pipex
. It should be equivalent to you executing ./pipex
and then reading the characters that you write in the input.
For the native execution I create a bash script, but that is only to make sure the program receives the input correctly (because I could not figure out a way to pass the input from python).
Maybe I'm not understanding it correctly, could you try to explain better with examples?