Message315005
| Author |
skip.montanaro |
| Recipients |
hathawsh, martin.panter, r.david.murray, skip.montanaro, vstinner, ztane |
| Date |
2018-04-05.19:40:33 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1522957233.46.0.682650639539.issue27805@psf.upfronthosting.co.za> |
| In-reply-to |
|
| Content |
I was bitten by this porting a system from Python 2.7 to 3.6. "/dev/stderr" is a very nice default for logfiles. Users will frequently override the default, so you really want to open the logfile in append mode. Having to jump through hoops to avoid blasting a user's logfile is kinda dumb, and as others have pointed out, error-prone.
os.open works just fine with O_WRONLY|O_APPEND as the flags. /dev/null can be opened in append mode, but not /dev/stderr or /dev/stdout. |
|