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.

classification
Title: Issue formating for log on Linux machines
Type: compile error Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: andrewsuttle56, methane
Priority: normal Keywords:

Created on 2021-09-05 15:53 by andrewsuttle56, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
program.txt andrewsuttle56, 2021-09-05 15:53 The program that errors
Messages (2)
msg401089 - (view) Author: Andrew Suttle (andrewsuttle56) Date: 2021-09-05 15:53
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
msg401124 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-09-06 07:15
It is fixed in Python 3.9.

* https://github.com/python/cpython/pull/14008
* https://bugs.python.org/issue37111

Python 3.8 is "security" status for now. Non-security issues won't be fixed.
Please migrate to Python 3.9.
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89269
2021-09-06 07:15:21methanesetstatus: open -> closed

nosy: + methane
messages: + msg401124

resolution: wont fix
stage: resolved
2021-09-05 15:53:18andrewsuttle56create