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.
Created on 2012年04月05日 06:45 by Drauger, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg157539 - (view) | Author: Максим Цыпкин (Drauger) | Date: 2012年04月05日 06:45 | |
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.
|
|||
| msg157577 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月05日 12:52 | |
Thanks for the report. I'm not familiar with multiprocessing, so I'll have to leave it to someone else to judge the fix. We use 'crash' to indicate a segfault in the Python interpreter, so I'm changing the type to 'behavior' (that is, a normal bug). |
|||
| msg166480 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年07月26日 12:59 | |
You could just do
Server_1=TestServer(address=("127.0.0.1",55555),authkey=b"passkey")
so this is probably a documentation issue. The examples in the documentation should at least be updated.
|
|||
| msg168443 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年08月17日 13:43 | |
New changeset 636f75da4b9e by Richard Oudkerk in branch '3.2': Issue #14501: Clarify that authentication keys are byte strings http://hg.python.org/cpython/rev/636f75da4b9e |
|||
| msg168444 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年08月17日 13:52 | |
I have fixed the documentation and examples to say that authentication keys are byte strings. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58706 |
| 2012年08月17日 13:52:24 | sbt | set | status: open -> closed resolution: fixed messages: + msg168444 stage: needs patch -> resolved |
| 2012年08月17日 13:43:35 | python-dev | set | nosy:
+ python-dev messages: + msg168443 |
| 2012年07月26日 12:59:39 | sbt | set | messages: + msg166480 |
| 2012年07月26日 00:23:11 | sbt | set | nosy:
+ sbt |
| 2012年07月25日 22:51:26 | ezio.melotti | set | nosy:
+ jnoller stage: needs patch |
| 2012年04月05日 12:52:36 | r.david.murray | set | versions:
+ Python 3.3 nosy: + r.david.murray, asksol messages: + msg157577 type: crash -> behavior |
| 2012年04月05日 06:45:54 | Drauger | create | |