homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jeremy Goss
Recipients Jeremy Goss, The Compiler, python-dev, vinay.sajip
Date 2015年03月18日.03:29:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426649369.29.0.832919474571.issue23207@psf.upfronthosting.co.za>
In-reply-to
Content
The argument validation in basicConfig has introduced another problem.
I cannot pass in an optional filename/filemode argument pair.
Previously, I passed in an optional logfile argument from ArgumentParser (which could be None). Now, I get a ValueError because filemode is not popped if filename is None.
logging.basicConfig(..., filename=args.logfile, filemode="w")
...
ValueError: Unrecognised argument(s): filemode
Suggested fix to place mode assignment alongside filename in basicConfig():
 filename = kwargs.pop("filename", None)
 mode = kwargs.pop("filemode", 'a')
 if filename:
 h = FileHandler(filename, mode)
History
Date User Action Args
2015年03月18日 03:29:29Jeremy Gosssetrecipients: + Jeremy Goss, vinay.sajip, python-dev, The Compiler
2015年03月18日 03:29:29Jeremy Gosssetmessageid: <1426649369.29.0.832919474571.issue23207@psf.upfronthosting.co.za>
2015年03月18日 03:29:29Jeremy Gosslinkissue23207 messages
2015年03月18日 03:29:28Jeremy Gosscreate

AltStyle によって変換されたページ (->オリジナル) /