You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python --version should send output to STDOUT #62538
Is there a workaround for python2? The issue is that autotools is checking that installed tools support --help and --version and it expects those to stdout:
bad=0; pid=$$; list="gtkdoc-check gtkdoc-depscan gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mkhtml gtkdoc-mkhtml2 gtkdoc-mkman gtkdoc-mkpdf gtkdoc-rebase gtkdoc-scan gtkdoc-scangobj gtkdocize"; forpin $list; do \
case' 'in \
*" $p "*|*" ../../$p "*) continue;; \
esac; \
f=`echo "$p" | sed 's,^.*/,,;s,x,x,'`; \
foroptin--help--version; do \
if"/home/ensonic/projects/gnome/gtk-doc/gtk-doc-1.27.1/_inst/bin/$f" $opt>c${pid}_.out \
2>c${pid}_.err</dev/null \
&&test-n"`cat c${pid}_.out`" \
&&test-z"`cat c${pid}_.err`"; then :; \
elseecho"$f does not support $opt"1>&2; bad=1; fi; \
done; \
done; rm-fc${pid}_.???; exit $badgtkdoc-checkdoesnotsupport--versiongtkdoc-fixxrefdoesnotsupport--versiongtkdoc-mkdbdoesnotsupport--versiongtkdoc-mkhtmldoesnotsupport--versiongtkdoc-mkhtml2doesnotsupport--versiongtkdoc-mkmandoesnotsupport--versiongtkdoc-mkpdfdoesnotsupport--versiongtkdoc-rebasedoesnotsupport--versiongtkdoc-scandoesnotsupport--versiongtkdoc-scangobjdoesnotsupport--versionMakefile:637: recipefortarget'installcheck-binSCRIPTS'failed
Activity
jaalto commentedon Jul 1, 2013
C.f. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603851
When user is calling program with options, it is not an error
condition to run:
The output is now sent to stderr. Please change to send to stdout as
in other *nix utilities, in order to collect in shell scrips:
version=$(python --version)
tiran commentedon Jul 1, 2013
Your proposal is reasonable. I'm flagging it for Python 3.4+ as it's a backward incompatible modification.
[-]option --version should send output to STDOUT[/-][+]python --version should send output to STDOUT[/+]RamchandraApte commentedon Jul 2, 2013
Agree.
berkerpeksag commentedon Jul 3, 2013
Here is a patch with an updated test.
The -v flag also sends the output to stderr. Should that be fixed too? See Modules/main.c:678 and Lib/test/test_cmd_line.py:l47
serhiy-storchaka commentedon Jul 3, 2013
LGTM.
RamchandraApte commentedon Jul 4, 2013
On 3 July 2013 15:16, Berker Peksag <report@bugs.python.org> wrote:
RamchandraApte commentedon Jul 4, 2013
No, I think that
On 3 July 2013 16:06, Serhiy Storchaka <report@bugs.python.org> wrote:
MatthewByrne commentedon Jul 8, 2013
Simply replced printout from stderr to stdout.
MichaelDickens commentedon Jul 9, 2013
Patch for bpo-18338. Changes output for --version and updates unit test accordingly.
python-dev commentedon Jul 11, 2013
New changeset e6384b8b2325 by Serhiy Storchaka in branch 'default':
Issue bpo-18338:
python --versionnow prints version string to stdout, andhttp://hg.python.org/cpython/rev/e6384b8b2325
python-dev commentedon Sep 6, 2013
New changeset 587bdb940524 by Eli Bendersky in branch 'default':
Update whatsnew/3.4 wrt. --version going to stdout. bpo-18338, bpo-18920, bpo-18922
http://hg.python.org/cpython/rev/587bdb940524
StefanSauer commentedon Mar 24, 2018
Is there a workaround for python2? The issue is that autotools is checking that installed tools support --help and --version and it expects those to stdout:
StefanSauer commentedon Mar 24, 2018
Sorry need to find the ticket for argparse ..