Skip to content

"lintian failed to run: None" ugly error report

2022-09-01_16-48

That None is horrible!..

It actually turns out that we are not collecting stderr at all!

https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError.stderr :

Stderr output of the child process if it was captured by run(). Otherwise, None.

Which means that stderr was never captured to begin with.

this is running debexpo_exec() which is defined as such:

def debexpo_exec(command, args, **kwargs):
    timeout = getattr(settings,
                      'SUBPROCESS_TIMEOUT_'
                      f'{basename(command).replace("-", "_").upper()}',
                      getattr(settings, 'SUBPROCESS_TIMEOUT', None))

    return check_output([command] + args,
                        timeout=timeout,
                        encoding='utf-8',
                        text=True,
                        **kwargs)

subprocess.check_output() has this piece of doc:

To also capture standard error in the result, use stderr=subprocess.STDOUT: which to me implies that .check_output() normally discards all stderr, and I believe it's so as by documentation this is the same as subprocess.run(..., check=True, stdout=PIPE).stdout, and .run()'s defaults is indeed stderr=None...

Now, I don't think I want stderr into the stdout stream, so that likely needs to use subprocess.PIPE or something. plus, this likely needs to go through all the debexpo_exec() invocations.

Edited by Mattia Rizzolo
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information