Title: sys-package-mgr should not print import action unless verbose is chosen
Type: behaviour Severity: urgent
Components: Jythonc compiler Versions: Jython 2.7, Jython 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: amak, ejannett, fwierzbicki, jeff.allen, zyasoft
Priority: urgent Keywords: RFE, patch

Created on 2010-03-15.15:01:39 by ejannett, last changed 2015-04-19.23:03:17 by jeff.allen.

File name Uploaded Description Edit Remove
silent_pkgmgr_issue1572.patch ejannett, 2013-06-05.09:43:11 fix on
msg5566 (view) Author: Emmanuel Jannetti (ejannett) Date: 2010-03-15.15:01:38
when jar are not already indexed , sys-pacakge-mgr prints statement to the console
This can interfere with the application . unless verbose option is chosen, sys-package-mgr 
should be quite
msg5568 (view) Author: Jim Baker (zyasoft) Date: 2010-03-15.21:41:09
We may want to have this verbosity depend on whether Jython is run interactively or not, but the request makes sense.
msg5569 (view) Author: Emmanuel Jannetti (ejannett) Date: 2010-03-16.08:16:24

In any case sys-package-mgr should print such statements by default. 
Jython may be used to implement a  console/interactive application.
msg8029 (view) Author: Emmanuel Jannetti (ejannett) Date: 2013-05-23.07:50:12
This seems easy to fix. such "noise" on the console really disturb any scripting around jython. message from package manager also happen any time an update of Java used is installed 

suggested fix
diff -r aa079dc20555 src/org/python/core/packagecache/
--- a/src/org/python/core/packagecache/	Sat May 11 19:28:25 2013 +0100
+++ b/src/org/python/core/packagecache/	Thu May 23 09:46:38 2013 +0200
@@ -272,7 +272,7 @@
                 if ((entry == null || !(new File(entry.cachefile).exists()))
                         && cache) {
-                    message("processing new jar, '" + jarcanon + "'");
+                    comment("processing new jar, '" + jarcanon + "'");
                     String jarname;
                     if (localfile) {
@@ -303,7 +303,7 @@
                 if (caching) {
                     this.indexModified = true;
                     if (entry.mtime != 0) {
-                        message("processing modified jar, '" + jarcanon + "'");
+                        comment("processing modified jar, '" + jarcanon + "'");
                     entry.mtime = mtime;
msg8038 (view) Author: Emmanuel Jannetti (ejannett) Date: 2013-06-05.09:43:10
fix succesfully tested:
- run 'ant regtests'
- run 'ant test'
- checked that no indexing message on new or modified jars happen unless '-v' launcher option is specified
msg8686 (view) Author: Jim Baker (zyasoft) Date: 2014-06-18.23:46:55
Agreed about the simplicity of the fix. This should be a configurable option however.

Target beta 4
msg8914 (view) Author: Jeff Allen (jeff.allen) Date: 2014-08-11.22:14:07
Note this from PyCon AU:
msg9093 (view) Author: Jim Baker (zyasoft) Date: 2014-10-06.03:16:01
Apply patch
msg9760 (view) Author: Jeff Allen (jeff.allen) Date: 2015-04-06.10:26:50
Reconsider skipped test test_doctest_main_issue4197 in test.test_zipimport_support, which seems to be a consequence of this issue.
msg9878 (view) Author: Jeff Allen (jeff.allen) Date: 2015-04-18.10:49:16
Nathaniel Kenmir's pull request (msg8914) adds the optionality Jim requested, but according to Bitbucket won't merge cleanly. I can resolve locally.
msg9879 (view) Author: Jeff Allen (jeff.allen) Date: 2015-04-18.11:54:45
On reflection I much prefer the simplicity of Emmanuel's original patch.


I may have misunderstood #msg8686. Do you mean something finer than Jython's global verbosity control? If we want control verbosity locally to parts of the application, a standard method (probably java.logging) is surely preferable to a point solution.
msg9880 (view) Author: Jim Baker (zyasoft) Date: 2015-04-18.14:28:55
Jeff, I agree with simplicity as the answer here. Although we have long seen this message from sys-package-mgr, and we find it perhaps familiar, even reassuring ;), it needs to be changed to better conform with CPython so that users can reliably script with Jython, including capturing stderr. A good recent example is the use of tox to drive cross-implementation testing in #2325 - small things like extra whitespace or an extra prompt can break such usage.

So please ignore my statement in msg8686, because I believe it was mistaken. Let's fix this please by making it purely a matter of being verbose overall or not, with no extra option needed to configure or implement.
msg9881 (view) Author: Jim Baker (zyasoft) Date: 2015-04-18.14:31:05
Marking urgent - we might as well get this into RC3. Looking forward to seeing Emmanuel's patch finally land! :)
msg9902 (view) Author: Jeff Allen (jeff.allen) Date: 2015-04-19.23:03:17
Committed at
Date User Action Args
2015-04-19 23:03:17jeff.allensetstatus: open -> closed
resolution: remind -> fixed
messages: + msg9902
2015-04-18 14:31:05zyasoftsetpriority: high -> urgent
messages: + msg9881
2015-04-18 14:28:56zyasoftsetmessages: + msg9880
2015-04-18 11:54:46jeff.allensetmessages: + msg9879
versions: + Jython 2.7
2015-04-18 10:49:17jeff.allensetassignee: jeff.allen
messages: + msg9878
2015-04-06 10:26:50jeff.allensetmessages: + msg9760
2014-10-06 03:16:01zyasoftsetpriority: high
messages: + msg9093
2014-08-11 22:14:08jeff.allensetnosy: + jeff.allen
messages: + msg8914
2014-06-18 23:46:55zyasoftsetmessages: + msg8686
2014-05-21 23:20:12zyasoftsetresolution: accepted -> remind
2013-06-05 09:43:11ejannettsetfiles: + silent_pkgmgr_issue1572.patch
keywords: + patch
messages: + msg8038
2013-05-23 07:50:13ejannettsetmessages: + msg8029
components: + Jythonc compiler
2013-02-26 23:24:52amaksetnosy: + amak
2013-02-20 19:35:30fwierzbickisetnosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.1
2011-01-07 16:12:19ejannettsetseverity: major -> urgent
2010-03-16 08:16:25ejannettsetmessages: + msg5569
2010-03-15 21:41:09zyasoftsetkeywords: + RFE
resolution: accepted
messages: + msg5568
nosy: + zyasoft
2010-03-15 15:01:39ejannettcreate