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.

Author Drauger
Recipients Drauger
Date 2012-04-05.06:45:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333608355.05.0.964001699487.issue14501@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-04-05 06:45:55Draugersetrecipients: + Drauger
2012-04-05 06:45:55Draugersetmessageid: <1333608355.05.0.964001699487.issue14501@psf.upfronthosting.co.za>
2012-04-05 06:45:54Draugerlinkissue14501 messages
2012-04-05 06:45:54Draugercreate