odb.git: Send captured-but-discarded output to DEVNULL#99
Conversation
|
The CI error is unrelated to these changes, I believe: it's the GPG changes: |
|
Oh well. I've opened #104 which should at least fix the |
|
@mystor Not sure if there's a way to re-run the GitHub actions, but I believe this PR is good to go otherwise. |
|
This PR is still good to go and had no conflicts, but has been rebased as well. |
This avoids buffering/consuming output that's always discarded.
The output was previously suppressed/discarded, but that mistake was made more visible by the explicit "stdout=DEVNULL" argument.
| cwd: Optional[Path] = None, | ||
| env: Dict[str, str] = None, | ||
| stdin: Optional[bytes] = None, | ||
| stdout: _FILE = PIPE, |
There was a problem hiding this comment.
OK. I guess the added consistency is because now input-related parameters come before all output-related ones.
|
|
||
|
|
||
| T = TypeVar("T") # pylint: disable=invalid-name | ||
| _FILE = Union[None, int, IO[Any]] |
There was a problem hiding this comment.
can we call this File to be consisten with the typing module?
There was a problem hiding this comment.
For context, this definition is directly inlined from subprocess.pyi as the type of that Popen argument: https://github.com/python/typeshed/blob/98afaa4c76d4279846f278eb5be8b99c391e6a99/stdlib/subprocess.pyi#L24
It's inlined here because it's not an exported type name, so I wasn't certain it would be importable in all supported versions. Alternatively it could also be done as:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from subprocess import _FILEMy only very minor concern with calling it File is increasing drift from Popen's type.
Preference between:
- Leave it as is
- Import it
- Change name to
File
?
|
LGTM |
|
Ok, then I think leaving it is fine (maybe add a note in the commit message). Importing would be ideal if possible (perhaps even with an alias).
I don't know much about Python, I guess it's just about the leading underscore (which by convention means "private")? |
The leading underscore is the conventional hint, but the practical hiccup was mainly that But I think you're right. Since CI runs on all versions, importing with a |
|
I believe the CI failure is again unrelated. See #113 for (potential) fix to the race conditions in the current editor-testing code. |
|
If it’s possible to rerun those tests, please do! |
|
Thanks for the fixes! |
This avoids buffering captured output that's always discarded. The parameter change from
nocapturetostdoutalso makes it possible to direct that output to some other file/pipe.