Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 8, 2005 13:19:58

B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

TypeError in _checklogin


When I try to login to the admin site I get a TypeError : a2b_base64()
argument 1 must be string or read-only character buffer, not
array.array

in django.models.core.Session::get_decoded(), line 83, the value of
self.session_data which is being passed to a2b_base64 is array('c',
'KGRwMQpTJ3Rlc3Rjb29raWUnCnAyClMnd29ya2VkJwpwMwpzLmQzZWUzNDJiMjkzNTZhZDAxYWNl\nYjI4NDUzNmRlZDQ2\n')

type(self.session_data) == <type 'array.array'>, but only "KGRw...Q2\n"
is in the database; I don't know where the 'c' is coming from.
Interestingly, session_data is not 'c', but 'K', and session_data
is not the session data, but 'G', so I'm a bit confused as to what is
going on, since what looks like an array is acting like the string it's
supposed to be.


I /did/ extend/replace auth.user, and so couldn't use django-admin to
create a superuser. Could something I didn't set up in the db be
causing this? or is this weirder than that?

Thoughts?

Offline

#2 Dec. 8, 2005 23:15:40

B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

TypeError in _checklogin


Alright, lesson #1: To avoid looking like an idiot, don't try to belt
out a mailing list question in 10 minutes before work. array.. not
list... duh.

So if I change
base64.decodestring(self.session_data)
to
base64.decodestring(self.session_data.tostring())
in django.models.core.Session::get_decoded(), line 83\
everything seems to work fine... but why was/is this broken in the
first place?

Offline

Board footer

Moderator control

Enjoy the 22nd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support