classification
Title: Logging failure with timestamp messages
Type: crash Stage:
Components: Windows Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: kinow, paul.moore, steve.dower, tim.golden, xtobes, zach.ware
Priority: normal Keywords:

Created on 2019-11-06 15:10 by xtobes, last changed 2019-12-02 01:21 by kinow.

Messages (2)
msg356138 - (view) Author: xtobes (xtobes) Date: 2019-11-06 15:10
This only happings on Windows, the scripts runs some seconds and then stops and exit with: Process finished with exit code -1073740940 (0xC0000374). This happens when the format variable of a logging config object contains the identifier '%(asctime)s'.
msg357698 - (view) Author: Bruno P. Kinoshita (kinow) * Date: 2019-12-02 01:21
I think this needs a script to reproduce the problem.

Tested first with Anaconda Python 3.7.1 on Win10 Pro. Not able to reproduce the issue. Smae with the latest version.

Using Python master and Win10Pro and timezone set to NZ (not that really matter, but just in case).

    Python 3.9.0a1+ (heads/master:2fe4c48917, Dec  2 2019, 14:12:32) [MSC v.1916 64 bit (AMD64)] on win32

with the example from https://docs.python.org/3/library/logging.html:

    import logging
    FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
    logging.basicConfig(format=FORMAT)
    d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
    logger = logging.getLogger('tcpserver')
    
    logger.warning('Protocol problem: %s', 'connection reset', extra=d)

Gives:

    2019-12-02 14:14:46,615 192.168.0.1 fbloggs  Protocol problem: connection reset

If I modify the example to use just %(asctime)s


    import logging
    FORMAT = '%(asctime)s'
    logging.basicConfig(format=FORMAT)
    d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
    logger = logging.getLogger('tcpserver')
    
    logger.warning('Protocol problem: %s', 'connection reset', extra=d)

Now gives:

    2019-12-02 14:18:29,047

Everything looks OK, at least on my environment.
History
Date User Action Args
2019-12-02 01:21:50kinowsetnosy: + kinow
messages: + msg357698
2019-11-06 15:10:27xtobescreate