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: Python 3 logging HTTPHandler doesn't implement a standard http basic authorize
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: TypeError in logging.HTTPHandler.emit; possible python 2 to 3 conversion issue
View: 27251
Assigned To: Nosy List: SenBin Yu, yan12125
Priority: normal Keywords:

Created on 2016-09-08 12:49 by SenBin Yu, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg275008 - (view) Author: SenBin Yu (SenBin Yu) Date: 2016-09-08 12:49
The standard http basic authorization is

basic-credentials = "Basic" SP basic-cookie

basic-cookie      = <base64 [5] encoding of userid-password,
                            except not limited to 76 char/line>

userid-password   = [ token ] ":" *TEXT

but the logging/handlers module do the fllowing:

s = ('u%s:%s' % self.credentials).encode('utf-8')

s = 'Basic ' + base64.b64encode(s).strip()

why there is a redundant chr 'u'?
msg275014 - (view) Author: (yan12125) * Date: 2016-09-08 13:35
There's indeed a 'u' in 3.5.1: https://hg.python.org/cpython/file/v3.5.1/Lib/logging/handlers.py#l1157 and latter fixed in 3.5.2: https://hg.python.org/cpython/file/v3.5.2/Lib/logging/handlers.py#l1159. Please consider update.
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72207
2016-09-08 14:04:48SilentGhostsetstatus: open -> closed
superseder: TypeError in logging.HTTPHandler.emit; possible python 2 to 3 conversion issue
resolution: duplicate
stage: resolved
2016-09-08 13:35:32yan12125setnosy: + yan12125
messages: + msg275014
2016-09-08 12:49:24SenBin Yucreate