Message6668

Author whistler11783
Recipients whistler11783
Date 2011-10-11.23:21:24
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1318375284.45.0.484825913534.issue1808@psf.upfronthosting.co.za>
In-reply-to
Content
With Jython 2.5.2(final)...which throws the exception unexpectedly...

-bash-3.00$ jython
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_18
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging.handlers as LH
>>> import logging
>>> log_file='/tmp/spam.log'
>>> lhandler = LH.TimedRotatingFileHandler(log_file, when='D', interval=7, backupCount=4)
>>> root_logger = logging.getLogger('')
>>> root_logger.setLevel(logging.DEBUG)
>>> formatter = logging.Formatter('%(asctime)s:%(process)d %(levelname)s %(message)s', "%Y%m%d%H%M%S")
>>> lhandler.setFormatter(formatter)
>>> root_logger.addHandler(lhandler)
>>> logging.debug('asdasdasddsdad')
Traceback (most recent call last):
  File "/jython2.5.2/Lib/logging/__init__.py", line 744, in emit
    msg = self.format(record)
  File "/jython2.5.2/Lib/logging/__init__.py", line 630, in format
    return fmt.format(record)
  File "/jython2.5.2/Lib/logging/__init__.py", line 421, in format
    s = self._fmt % record.__dict__
TypeError: int argument required
>>> exit()

This is unexpected.

Example using Python 2.4.6...This works as expected...

Python 2.4.6 (#1, Dec 13 2009, 23:43:51) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> import logging.handlers as LH
>>> log_file='/tmp/spam.log'
>>> lhandler = LH.TimedRotatingFileHandler(log_file, when='D', interval=7, backupCount=4)
>>> root_logger = logging.getLogger('')
>>> root_logger.setLevel(logging.DEBUG)
>>> formatter = logging.Formatter('%(asctime)s:%(process)d %(levelname)s %(message)s', "%Y%m%d%H%M%S")
>>> lhandler.setFormatter(formatter)
>>> root_logger.addHandler(lhandler)
>>> logging.debug('asdasdasddsdad')
>>> ^D

And another example using Python 2.6.2...which also works fine...

Python 2.6.2 (r262:71600, Aug 11 2009, 07:38:25)
[GCC 4.3.3] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> import logging.handlers as LH
>>> log_file='/tmp/spam.log'
>>> lhandler = LH.TimedRotatingFileHandler(log_file, when='D', interval=7, backupCount=4)
>>> root_logger = logging.getLogger('')
>>> root_logger.setLevel(logging.DEBUG)
>>> formatter = logging.Formatter('%(asctime)s:%(process)d %(levelname)s %(message)s', "%Y%m%d%H%M%S")
>>> lhandler.setFormatter(formatter)
>>> root_logger.addHandler(lhandler)
>>> logging.debug('asdasdasddsdad')
>>> exit()
-bash-3.00$

The version of Jython I am using:
-bash-3.00$ jython
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_18
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import platform
>>> print sys.version_info
(2, 5, 2, 'final', 0)
>>> print platform.uname()
('Java', 'host.notimportant.com', '1.6.0_18', 'Java HotSpot(TM) Server VM, 16.0-b13, Sun Microsystems Inc.', '', '')

Let me know if you need any other information.
History
Date User Action Args
2011-10-11 23:21:24whistler11783setrecipients: + whistler11783
2011-10-11 23:21:24whistler11783setmessageid: <1318375284.45.0.484825913534.issue1808@psf.upfronthosting.co.za>
2011-10-11 23:21:24whistler11783linkissue1808 messages
2011-10-11 23:21:24whistler11783create