-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'bytes' object has no attribute 'encode' #64
Comments
Updated by CTimmerman2 on 2011-07-27T16:03:29 Same here. It worked fine before; I don't know what broke it.
|
Updated by CTimmerman2 on 2011-07-27T16:09:33
Installed (again) from PyMySQL3-0.4.tar.gz: C:\home\CT\PyMySQL3-0.4>c:\python32\python setup.py install |
I had the same problem, and looking at the code I found: ----------------------------------------- (line 855)
at this point self.data is a bytes var, which does not have an encode method. |
For me this problem was due to the usage of the old authentication method (cf. http://dev.mysql.com/doc/internals/en/authentication-method.html). Creating a new user (resetting the password might work as well) and making sure that the |
Seems now altering this
to this
for MySQL 5.0.77 at least and django trunk (as of today) mends the issue .. i.e. things are already Bytes |
That actually didn't work for me - I only needed to get rid of the encode after self.salt, not self.password. If I get rid of both, I get further downstream errors. Regardless, this seems to be a very easy fix. Is there a way for one of us to commit the change back to the repository? |
Fixed via 1a24311 . |
Originally filed by dhj...@gmail.com on 2011-05-24T21:33:19
Using the example program on the home page (with Python3), I tried to access a database on a remote linux server. The password was assigned a valid string (rather than None).
In connections.py, I'm seeing the error described in summary.
It is happening in the second argument to _scamble_323, it does not seem to like trying to execute the method 'encode' on the object variable 'salt'. I have checked and 'salt' does have a legitimate binary value.
However, my Python is not yet good enough for me to be able to debug this issue for myself.
Thanks in advance
The text was updated successfully, but these errors were encountered: