[issue21338] Silent mode for compileall
Roundup Robot added the comment: New changeset 34436ae65523 by Berker Peksag in branch 'default': Issue #21338: Add silent mode for compileall. https://hg.python.org/cpython/rev/34436ae65523 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Berker Peksag added the comment: Thanks for the patch, Thomas. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Berker Peksag added the comment: Here's an updated patch. Thanks David. -- Added file: http://bugs.python.org/file36808/issue21338.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
R. David Murray added the comment: Berker: I had some review comments pending on the docs, but reitveld isn't letting me publish them for some reason (it says the patch set doesn't exist). The comments are: the method docs should probably say ``False`` or ``0`` (the default) (and all the numbers should be marked up as code), and the versionchanged I think should say that the option was changed to a multilevel value. Otherwise the patch looks good to me, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Changes by Berker Peksag berker.pek...@gmail.com: -- assignee: - berker.peksag nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Éric Araujo added the comment: Patch looks to me comprehensive and backward-compatible. Thanks Thomas! -- nosy: +eric.araujo stage: needs patch - commit review type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
New submission from Thomas Kluyver: The compileall module's command line interface has a -q (quiet) flag which suppresses most of the output, but it still prints error messages. I'd like an entirely silent mode with no output. My use case is byte-compiling Python files as part of a graphical installer. I do this by running: py -${PY_QUALIFIER} -m compileall -q $INSTDIR\pkgs I'd like to be able to use pyw so a terminal doesn't pop up, but if I do that, it exits early. I think this is due to the issue with stdout/stderr buffers filling up on pythonw. -- components: Library (Lib) messages: 217100 nosy: takluyver priority: normal severity: normal status: open title: Silent mode for compileall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Ezio Melotti added the comment: This seems a reasonable request. Do you want to propose a patch? -- keywords: +easy nosy: +ezio.melotti stage: - needs patch type: - enhancement versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Thomas Kluyver added the comment: Patch attached. This works by making the -q flag countable, so you pass -qq to suppress all output. In the Python API, the quiet parameter has become an integer, so passing 2 is equivalent to -qq. This should be fully backwards compatible with passing True and False, which are equivalent to 1 and 0. -- keywords: +patch type: enhancement - Added file: http://bugs.python.org/file35012/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Changes by Thomas Kluyver tak...@gmail.com: Removed file: http://bugs.python.org/file35012/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Steven D'Aprano added the comment: Can't you just re-direct stdout or stderr? I'm sure that works even on Windows. E.g. py -${PY_QUALIFIER} -m compileall -q $INSTDIR\pkgs 2 null Is there a reason you cannot do this? I think that adding functionality to compileall to duplicate what your OS already provides should be a last resort. I also don't understand what you mean by it exits early. What exits early? Surely python doesn't exit until compileall finishes running. If it does, that's a bug. -- nosy: +steven.daprano ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Thomas Kluyver added the comment: Sorry, I somehow attached an old version of the patch. This one should be correct. Steven: Redirection relies on a shell - the native 'run a process' interface that the installer uses can't do that. There are ways to work around this, but I think this approach makes sense. It exits early because stdout and stderr don't go anywhere, so once either of them has filled up a fairly small buffer, attempts to write to it throw an error. I'd love to see that fixed, but it's been known about for years (see issue 706263), and it seems unlikely to change any time soon. -- Added file: http://bugs.python.org/file35013/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Changes by Thomas Kluyver tak...@gmail.com: Removed file: http://bugs.python.org/file35013/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Thomas Kluyver added the comment: Gah, still wrong. Trying again. -- Added file: http://bugs.python.org/file35014/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21338] Silent mode for compileall
Thomas Kluyver added the comment: In fact, I will probably end up working around this anyway, because I'll have to support versions of Python without this fix for some time. So I don't feel strongly that it needs to go in, but I will do any revisions or changes requested if people think it would be useful. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com