Closed ssolidsnake closed 9 months ago
I cannot reproduce this, the current version of patool should work as-is. Can you check which version of patool you are using, or post the exact command?
In the most recent version, subprocess.DEVNULL
will only be used when verbosity is zero or less, see here: https://github.com/wummel/patool/blob/8358491e7f9cabcbf3728cc490525ef925fd4cb1/patoolib/util.py#L84
And in patoolib/cli.py
and patoolib/__init__.py
the default verbosity for list_archive() is 1:
https://github.com/wummel/patool/blob/97b1efbf810061ebee0befbfaeec067dc6472f7d/patoolib/__init__.py#L748
https://github.com/wummel/patool/blob/8358491e7f9cabcbf3728cc490525ef925fd4cb1/patoolib/cli.py#L56
A new version 2.2.0 of patool has been released on 14.02.2024. Therefore this bug will be closed. If you think this issue is not solved, please open a new issue.
The
list_archive
method doesn't display the command line output, whether by using the library or the command line (patool list <file_to_path>
)OS: Windows 10.0.19045 IDE: VSCode 1.85.0
You need to remove
subprocess.DEVNULL
in therun
method, but this will display what comes out from the output everytime your run any function (evenextract_archive()
).To fix this, I set the
verbosity
to 2 in thelist_archive()
method and two conditions in therun
method, one to change stdout in thesubprocess.run
fromDEVNULL
toPIPE
(More explanations in the comments), and another one to display the output only whenlist_archive
is called.Both
patoolib.py
andcli.py
are both fixed and works perfectly. This is my first contribution, I hope this is a good fix for the issue, but if you have a better fix, I'd love to see how more experienced programmers solve their problems.