Bugs item #3605062, was opened at 2013-02-17 06:02 Message generated for change (Comment added) made by tgr_ You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605062...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: other Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tgr (tgr_) Assigned to: Nobody/Anonymous (nobody) Summary: pywikipediabot should use standard output
Initial Comment: All pywikipedia messages go to standard error, making the proper running of such bots from cron very difficult. Normal messages should go to standard output, and only suprising messages (python errors, block notifications, new message notifcations) should go to standard error.
----------------------------------------------------------------------
Comment By: Tgr (tgr_)
Date: 2013-02-17 12:50
Message: I disagree. Non-zero return value is for errors from which the application could not recover. There might be errors or unexpected important events which do not cause the bot to fail but should be reported nevertheless. (For example if an interwikibot gets a talk page message on one of the many wikis it visits, that should be reported, maybe the bot should stop working on that wiki until the owner can check the message, but it certainly should not stop working on all other wikis.)
If you want to show human-readable output to humans, and machine-processable output to scripts, the proper solution for that is to detect (via sys.stdout.isatty()) whether you are writing to a terminal, and format accordingly (and allow overriding the behavior via a command line switch). That is how sophisticated command line applications usually operate; compare, for example, the output from 'ls' and 'ls | cat'.
----------------------------------------------------------------------
Comment By: Merlijn S. van Deen (valhallasw) Date: 2013-02-17 09:16
Message: Data that can be used for further processing ('pipe') should be sent to stdout. All messages that are only relevant for the user should be sent to stderr. Errors should not be detected by checking if anything was written to stderr, but by checking the return value (which will be non-zero if an error occurred).
Basically, this is a well-known cron problem. See, for instance, http://habilis.net/cronic/
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605062...
pywikipedia-bugs@lists.wikimedia.org