# Path: fuzzinator/call/non_issue.py
# class NonIssue(dict):
#     """
#     Wrapper class for issue dictionaries to mark them as non-issue.
# 
#     The ``NonIssue`` class is a custom dictionary with a truth value forced to
#     ``False``. With this change, it's capable to express that an issue
#     dictionary doesn't encode a failure, without emptying it or converting to
#     ``None``. The content of a ``NonIssue`` can be taken as a SUT response to a
#     given test case and can be useful in feedback-driven fuzzing scenarios.
#     """
# 
#     def __bool__(self):
#         return False


import logging
import os
import subprocess
import time
from ..config import as_bool, as_dict, as_pargs, as_path, decode
from .call import Call
from .non_issue import NonIssue
        issue = {}

        try:
            start_time = time.time()
            result = subprocess.run(as_pargs(self.command),
                                    input=test,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
                                    cwd=self.cwd,
                                    env=self.env,
                                    timeout=timeout or self.timeout,
                                    check=False)
            end_time = time.time()
            stdout, stderr = decode(result.stdout, self.encoding), decode(result.stderr, self.encoding)
            logger.debug('%s\n%s', stdout, stderr)

            issue = {
                'exit_code': result.returncode,
                'stdout': stdout,
                'stderr': stderr,
                'time': end_time - start_time,
            }
            if self.no_exit_code or result.returncode != 0:
                return issue
        except subprocess.TimeoutExpired as e:
            logger.debug('StdinSubprocessCall execution timeout (%ds) expired.\n%s\n%s',
                         e.timeout,
                         decode(e.stdout, self.encoding),
                         decode(e.stderr, self.encoding))


# Path: fuzzinator/call/non_issue.py
# class NonIssue(dict):
#     """
#     Wrapper class for issue dictionaries to mark them as non-issue.
# 
#     The ``NonIssue`` class is a custom dictionary with a truth value forced to
#     ``False``. With this change, it's capable to express that an issue
#     dictionary doesn't encode a failure, without emptying it or converting to
#     ``None``. The content of a ``NonIssue`` can be taken as a SUT response to a
#     given test case and can be useful in feedback-driven fuzzing scenarios.
#     """
# 
#     def __bool__(self):
#         return False


# Path: fuzzinator/call/stdin_subprocess_call.py
import logging
import os
import subprocess
import time
from ..config import as_bool, as_dict, as_pargs, as_path, decode
from .call import Call
from .non_issue import NonIssue

        issue = {}

        try:
            start_time = time.time()
            result = subprocess.run(as_pargs(self.command),
                                    input=test,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
                                    cwd=self.cwd,
                                    env=self.env,
                                    timeout=timeout or self.timeout,
                                    check=False)
            end_time = time.time()
            stdout, stderr = decode(result.stdout, self.encoding), decode(result.stderr, self.encoding)
            logger.debug('%s\n%s', stdout, stderr)

            issue = {
                'exit_code': result.returncode,
                'stdout': stdout,
                'stderr': stderr,
                'time': end_time - start_time,
            }
            if self.no_exit_code or result.returncode != 0:
                return issue
        except subprocess.TimeoutExpired as e:
            logger.debug('StdinSubprocessCall execution timeout (%ds) expired.\n%s\n%s',
                         e.timeout,
                         decode(e.stdout, self.encoding),
                         decode(e.stderr, self.encoding))


        return NonIssue(issue) if issue else None