On 02/15/11 09:47 AM, Karen Tung wrote:
Hi Keith,
The changes look good to me.
Your examples lead me to think of an usage example
that might be confusing to users.
If people want to log stdout and stderr, they have to
specify:
Popen(cmd, stdout=Popen.STORE, stderr=Popen.STORE, logger=mylogger)
if I just specify:
Popen(cmd, logger=mylogger)
nothing will get logged, and no warning is displayed saying why.
The above syntax is not very intuitive, in my opinion,
because if I didn't read the document on how to
use this API, it's natural to think that if I want to log something,
I just provide the logger and everything will be taken care of.
Can we at least display a warning if they specify a logger
but not stdout and stderr? I think it is even better to automatically
assign stdout and stderr to Popen.STORE if a logger is provided,
but those values are not set.
Hi Karen,
You bring up a very good point. In general, I'm trying to keep the
validation lax (I'd rather leave open a door to make a mistake than lock
out a viable, if rare, use case). However, in this case, while having
either stdout *or* stderr be set to None would be reasonable when using
the logger, if *both* are None (and logger is set), it's clearly an
error. I'll update to raise a ValueError in this case.
- Keith
Thanks,
--Karen
On 02/14/11 17:50, Keith Mitchell wrote:
Hi all,
Can I get a review of my changes for these bugs please?
Bugs:
7019067 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=7019067>
solaris_install.Popen logs blank lines
7018063 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=7018063>
solaris_install.Popen should allow a user to ignore the check_code check
7018060 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=7018060>
solaris_install.Popen should offer a DEVNULL destination
Webrev:
http://cr.opensolaris.org/~kemitche/webrev.7019067
In addition to resolving the listed bugs, I've:
- Added usage examples to the docstring for Popen
- Added docstrings to the test cases
- Resolved a bug where subprocesses that completed quickly may
hang in the select.select() call when attempting to perform logging.
(e.g., running Popen(["pkg", "foo"], logger=mylogger) would hit this)
Thanks,
Keith
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss