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 vinay.sajip
Recipients Alexandr, r.david.murray, vinay.sajip
Date 2011-08-10.19:19:38
SpamBayes Score 2.0066837e-07
Marked as misclassified No
Message-id <1313003978.92.0.73449694031.issue12718@psf.upfronthosting.co.za>
In-reply-to
Content
Okay, the problem occurs because builtin functions and Python functions are handled differently. This is how you need to set a Python importer:

vinay@eta-natty:~$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging.config
>>> BC = logging.config.BaseConfigurator
>>> from importlib import import_module
>>> class CC(BC):
...     importer = staticmethod(import_module)
... 
>>> CC.importer
<function import_module at 0xb746db54>
>>> CC.importer('pickle')
<module 'pickle' from '/usr/lib/python2.7/pickle.pyc'>
>>> CC({}).importer('pickle')
<module 'pickle' from '/usr/lib/python2.7/pickle.pyc'>

I will update the documentation to indicate this, but I don't think a change to logging.config is needed.
History
Date User Action Args
2011-08-10 19:19:39vinay.sajipsetrecipients: + vinay.sajip, r.david.murray, Alexandr
2011-08-10 19:19:38vinay.sajipsetmessageid: <1313003978.92.0.73449694031.issue12718@psf.upfronthosting.co.za>
2011-08-10 19:19:38vinay.sajiplinkissue12718 messages
2011-08-10 19:19:38vinay.sajipcreate