我今天注意到一些奇怪的事情,我想解释一下。我不是 100% 确定如何将其表述为一个问题,所以谷歌是不可能的。由于某些奇怪的原因,日志记录模块无权访问模块 logging.handlers。不信你自己试试:
>>> import logging
>>> logging.handlers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'handlers'
>>> import logging.handlers
>>> logging.handlers
<module 'logging.handlers' from '/usr/lib/python2.6/logging/handlers.pyc'>
谁能解释为什么会这样?