New submission from Andrew Suttle <andrewsuttl...@gmail.com>:

Using the format option for Python logging works fine on all windows machines:

logging.basicConfig(filename='log.log', encoding='utf-8', 
level=logging.DEBUG,format='%(asctime)s : %(message)s ')

But error occurs on Linux mint 64 20.2 using Python 3.8 when the % symbol in 
the format causes a problem.

Traceback (most recent call last):
File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode
exec(code, self.locals)
File "/media/victor/B694-5211/python now git/prototype server3.py", line 14, in
logging.basicConfig(filename='log.log', encoding='utf-8', 
level=logging.DEBUG,format='%(asctime)s:%(message)s')
File "/usr/lib/python3.8/logging/init.py", line 2009, in basicConfig
raise ValueError('Unrecognised argument(s): %s' % keys)
ValueError: Unrecognised argument(s): encoding

----------
files: program.txt
messages: 401089
nosy: andrewsuttle56
priority: normal
severity: normal
status: open
title: Issue formating for log on Linux machines
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file50261/program.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45106>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to