Python logging package doesn't work when I run in Komodo

Posted by kevinw on 2006-07-19 13:17
OS: Windows | Product: Komodo | tags: komodo logging python
Question: 

The documentation states that logging.basicConfig() will take arguments as of Python 2.4, but when I run my script from Komodo, Python says that it should not be given arguments.

Answer: 

The documentation states that logging.basicConfig() will take arguments (new to 2.4), however if this is used in the interpreter it will throw an exception, reporting back that no arguments are allowed.

From documentation (section 6.29.2):
Changed in version 2.4: formerly basicConfig did not take any keyword arguments.

However:

import logging
logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s',
 filename="Testing", filemode="w" )
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo 3.5\lib\support\dbgp\pythonlib\dbgp\client.py",
 line 3241, in runcode
    locals = self.frame.f_locals)
  File "C:\Program Files\ActiveState Komodo 3.5\lib\support\dbgp\pythonlib\dbgp\client.py", 
line 1583, in runcode
    h_exec(code, globals=globals, locals=locals, module=module)
  File "C:\Program Files\ActiveState Komodo 3.5\lib\support\dbgp\pythonlib\dbgp\client.py", 
line 520, in __init__
    exec code in globals, locals
  File "", line 0, in __main__
TypeError: basicConfig() takes no arguments (4 given)

System:
Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on win32

The problem is that the MSI installer did not uninstall all of the files. Specifically, the directory C:\Program Files\ActiveState Komodo 3.5\lib\support\dbgp\pythonlib\logging should have been removed. Removing this directory will fix the problem.

z00m1n | Mon, 2006-09-18 18:27

I ran into this problem, removed the ...\pythonlib\logging directory, removed Komodo, downloaded and installed newer version (3.5.3 instead of 3.5.2)...

The problem persists, AFAICT exactly the same as before.

I don't get the exception when I run the 2 lines from the example above in the Python shell...

What am I doing wrong ?

Regards,

z00m1n

kevinw
ActiveState Staff
Mon, 2006-10-16 13:38

If you have both Python 2.3 and Python 2.4 installed on your system, it is possible that the Python shell you don't get the exception in is version 2.4 and Komodo is set to use 2.3. I've had that happen to me before.

Cheers,

kjw