[New-bugs-announce] [issue14501] Error initialising BaseManager class with 'authkey' argument of string type.
Максим Цыпкин
report at bugs.python.org
Thu Apr 5 08:45:55 CEST 2012
New submission from Максим Цыпкин <draugervan at gmail.com>:
The following code:
class TestServer(BaseManager):pass
Server_1=TestServer(address=("127.0.0.1",55555),authkey="passkey")
produces following error in python 3.2 :
"TypeError: string argument without an encoding"
The cause is in BaseManager constructor implementation (Python32\Lib\multiprocessing\managers.py):
self._authkey = AuthenticationString(authkey)
The "AuthenticationString" class is a substitute of "bytes" class, and
"bytes" class requires second encoding argument, if first argument is a string.
I've solved this problem, changing the code in "Python32\Lib\multiprocessing\managers.py" to following:
if isinstance(authkey,str):
self._authkey = AuthenticationString(authkey,'utf-8')
else:
self._authkey = AuthenticationString(authkey)
This works for me. Please consider to fix this issue in release.
----------
components: Extension Modules
messages: 157539
nosy: Drauger
priority: normal
severity: normal
status: open
title: Error initialising BaseManager class with 'authkey' argument of string type.
type: crash
versions: Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14501>
_______________________________________
More information about the New-bugs-announce
mailing list