I have a site set up on Windows 2008, IIS 7.5, python 2.6.
When attempting to log in to the site using an external provider (Google, twitter, etc.) I receive a 500 error page and an error log entry like this:
c:\\djangoweb\\osqa\\forum\\templatetags\\ui_registry.py TIME: 2011-05-04 15:08:57,676 MSG: ui_registry.py:render:26 Exception 'request' rendering ui objects <forum.modules.ui_objects.Link object at 0x02A19590>:
Traceback (most recent call last):
File "C:\\DjangoWeb\\OSQA\\forum\\templatetags\\ui_registry.py", line 22, in render
result += ui_object.render(context)
File "C:\\DjangoWeb\\OSQA\\forum\\modules\\ui_objects.py", line 107, in render
html.hyperlink(self.url(context), self.text(context), **self.attrs(context)),
File "C:\\DjangoWeb\\OSQA\\forum\\modules\\ui_objects.py", line 67, in __call__
return self.argument(user, context)
File "C:\\DjangoWeb\\OSQA\\forum\\registry.py", line 42, in <lambda>
url=lambda u, c: settings.CONTACT_URL and settings.CONTACT_URL or "%s?next=%s" % (reverse('feedback'), cleanup_urls( c['request'].path)),
File "C:\\Python26\\lib\\site-packages\\django-1.2.5-py2.6.egg\\django\\template\\context.py", line 46, in __getitem__
raise KeyError(key)
KeyError: 'request'
I turned on Debug mode in settings_local.py and get the actual error
ValueError at /account/google/signin/
Parameter to Write() must be a string
The ultimate error seems to be in build\\bdist.win32\\egg\\openid\\oidutil.py in log
109. sys.stderr.write(message)
With message = u'Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOQobUcX2N_e1Rm6dqH1QiN5IvNp8iTioUlIhmlpVON3UV5e45Qejs39'
I don't see why I would get this error, could it be caused by the fact the string is a Unicode String?
How would I resolve this error?
Edit:
Having looked a little further it seems the error "Parameter to Write() must be a string" is part of PyISAPIe on line 255 (at time of writing)
http://sys.cs.pdx.edu/trac/PyISAPIe/browser/Trunk/PyISAPIe/Module/ReadWrite.cpp?rev=142
This line would be only hit if the type check on the output string fails.
In this case, is it possible the fact the string appears to be Unicode would cause this test to fail?
Is there any reason the site would be generating Unicode strings rather than any other kind of string?
Is there any way to change this behaviour such as a config setting?
I apologise if this has turned into a question more generally about Python than OSQA itself.
As a temporary work around I was able to redirect the StdErr to a file with a couple of lines added to the settings_local.py which did allow use of google and other providers as a login provider. This is by no means ideal but a step in the right direction.
Thanks,
Rob
asked
04 May '11, 15:08
RobP
31●2●4●6
accept rate:
0%
@RobP, please make sure your postings at meta.osqa.net have a clear, specific question as their title. "Error when using OpenID oAuth logins" is not a question. Thanks.
Thanks for editing @rickross , I shall keep that in mind for future posts