#9935 closed (wontfix)
The session db backend throws UnicodeEncodeError when used with Oracle
Reported by: | jamesli | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sessions | Version: | 1.0 |
Severity: | Keywords: | oracle session unicode UnicodeEncodeError | |
Cc: | Goldan | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I can reproduce the problem with the following environment:
Windows XP Pro
Python 2.5.2
Oracle 10g XE (Universal)
Django 1.0.2 final
(I tend to think it is a Django/Oracle combination problem, because I can't reproduce the bug with MySQL or Postgres.)
I was walking through the tutorial, during which I installed the 'admin' site. I went to http://127.0.0.1:8000/admin/ and logged in with user name and password, and then hit the following error.
UnicodeEncodeError at /admin/ 'ascii' codec can't encode characters in position 0-42: ordinal not in range(128) Request Method: POST Request URL: http://127.0.0.1:8000/admin/ Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-42: ordinal not in range(128) Exception Location: C:\Python25\lib\base64.py in decodestring, line 321 Python Executable: C:\Python25\python.exe Python Version: 2.5.2 Python Path: ['C:\\django\\mysite', 'C:\\IBMTOOLS\\utils\\support', 'C:\\IBMTOOLS\\utils\\logger', 'C:\\WINDOWS\\system32\\python25.zip', 'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win', 'C:\\Python25\\lib\\lib-tk', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages'] Server time: Tue, 30 Dec 2008 19:42:28 -0800 Unicode error hint The string that could not be encoded/decoded was: 䅧㥊兣噆湃汒㍣橒㉢爹坡硖汁䝕㉤礹㉡歖兣穎浌穑呏硫坚歊浍㑍呎祉呙硉䝏㉍橙穑呚橊娊則奫婺੬zOTkx Traceback: Environment: Request Method: POST Request URL: http://127.0.0.1:8000/admin/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in root 140. if not self.has_permission(request): File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in has_permission 99. return request.user.is_authenticated() and request.user.is_staff File "C:\Python25\Lib\site-packages\django\contrib\auth\middleware.py" in __get__ 5. request._cached_user = get_user(request) File "C:\Python25\Lib\site-packages\django\contrib\auth\__init__.py" in get_user 83. user_id = request.session[SESSION_KEY] File "C:\Python25\Lib\site-packages\django\contrib\sessions\backends\base.py" in __getitem__ 46. return self._session[key] File "C:\Python25\Lib\site-packages\django\contrib\sessions\backends\base.py" in _get_session 172. self._session_cache = self.load() File "C:\Python25\Lib\site-packages\django\contrib\sessions\backends\db.py" in load 18. return self.decode(force_unicode(s.session_data)) File "C:\Python25\Lib\site-packages\django\contrib\sessions\backends\base.py" in decode 93. encoded_data = base64.decodestring(session_data) File "C:\Python25\lib\base64.py" in decodestring 321. return binascii.a2b_base64(s) Exception Type: UnicodeEncodeError at /admin/ Exception Value: 'ascii' codec can't encode characters in position 0-42: ordinal not in range(128)
Change History (11)
comment:1 by , 16 years ago
Component: | django.contrib.admin → django.contrib.sessions |
---|---|
Description: | modified (diff) |
comment:2 by , 16 years ago
Keywords: | session unicode added; admin removed |
---|---|
Summary: | When used with Oracle XE, admin page throws UnicodeEncodeError → The session db backend throws UnicodeEncodeError when used with Oracle |
I'm having the same issue against an Oracle 10.2.0.4 database. I'm getting this error at the standard login page (http://lablnx04/accounts/login/). I get the login screen, then after a successful login, this error is thrown.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>UnicodeDecodeError at /accounts/login/</title> <style type="text/css"> html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; } h2 { margin-bottom:.8em; } h2 span { font-size:80%; color:#666; font-weight:normal; } h3 { margin:1em 0 .5em 0; } h4 { margin:0 0 .5em 0; font-weight: normal; } table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; } tbody td, tbody th { vertical-align:top; padding:2px 3px; } thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; } tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; } table.vars { margin:5px 0 2px 40px; } table.vars td, table.req td { font-family:monospace; } table td.code { width:100%; } table td.code div { overflow:hidden; } table.source th { color:#666; } table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; } ul.traceback { list-style-type:none; } ul.traceback li.frame { margin-bottom:1em; } div.context { margin: 10px 0; } div.context ol { padding-left:30px; margin:0 10px; list-style-position: inside; } div.context ol li { font-family:monospace; white-space:pre; color:#666; cursor:pointer; } div.context ol.context-line li { color:black; background-color:#ccc; } div.context ol.context-line li span { float: right; } div.commands { margin-left: 40px; } div.commands a { color:black; text-decoration:none; } #summary { background: #ffc; } #summary h2 { font-weight: normal; color: #666; } #explanation { background:#eee; } #template, #template-not-exist { background:#f6f6f6; } #template-not-exist ul { margin: 0 0 0 20px; } #unicode-hint { background:#eee; } #traceback { background:#eee; } #requestinfo { background:#f6f6f6; padding-left:120px; } #summary table { border:none; background:transparent; } #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; } #requestinfo h3 { margin-bottom:-1em; } .error { background: #ffc; } .specific { color:#cc3300; font-weight:bold; } h2 span.commands { font-size:.7em;} span.commands a:link {color:#5E5694;} pre.exception_value { font-family: sans-serif; color: #666; font-size: 1.5em; margin: 10px 0 10px 0; } </style> <script type="text/javascript"> //<!-- function getElementsByClassName(oElm, strTagName, strClassName){ // Written by Jonathan Snook, http://www.snook.ca/jon; Add-ons by Robert Nyman, http://www.robertnyman.com var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\-"); var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)"); var oElement; for(var i=0; i<arrElements.length; i++){ oElement = arrElements[i]; if(oRegExp.test(oElement.className)){ arrReturnElements.push(oElement); } } return (arrReturnElements) } function hideAll(elems) { for (var e = 0; e < elems.length; e++) { elems[e].style.display = 'none'; } } window.onload = function() { hideAll(getElementsByClassName(document, 'table', 'vars')); hideAll(getElementsByClassName(document, 'ol', 'pre-context')); hideAll(getElementsByClassName(document, 'ol', 'post-context')); hideAll(getElementsByClassName(document, 'div', 'pastebin')); } function toggle() { for (var i = 0; i < arguments.length; i++) { var e = document.getElementById(arguments[i]); if (e) { e.style.display = e.style.display == 'none' ? 'block' : 'none'; } } return false; } function varToggle(link, id) { toggle('v' + id); var s = link.getElementsByTagName('span')[0]; var uarr = String.fromCharCode(0x25b6); var darr = String.fromCharCode(0x25bc); s.innerHTML = s.innerHTML == uarr ? darr : uarr; return false; } function switchPastebinFriendly(link) { s1 = "Switch to copy-and-paste view"; s2 = "Switch back to interactive view"; link.innerHTML = link.innerHTML == s1 ? s2 : s1; toggle('browserTraceback', 'pastebinTraceback'); return false; } //--> </script> </head> <body> <div id="summary"> <h1>UnicodeDecodeError at /accounts/login/</h1> <pre class="exception_value">'utf16' codec can't decode bytes in position 120-121: illegal UTF-16 surrogate</pre> <table class="meta"> <tr> <th>Request Method:</th> <td>GET</td> </tr> <tr> <th>Request URL:</th> <td>http://lablnx04/accounts/login/</td> </tr> <tr> <th>Exception Type:</th> <td>UnicodeDecodeError</td> </tr> <tr> <th>Exception Value:</th> <td><pre>'utf16' codec can't decode bytes in position 120-121: illegal UTF-16 surrogate<pre></td> </tr> <tr> <th>Exception Location:</th> <td>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py in convert_values, line 59</td> </tr> <tr> <th>Python Executable:</th> <td>/usr/bin/python</td> </tr> <tr> <th>Python Version:</th> <td>2.4.2</td> </tr> <tr> <th>Python Path:</th> <td>['/usr/local/lib64/python2.4/site-packages/discovery-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio.gdocs-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio.google-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio.imap-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio.threads-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio.util-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/setuptools-0.6c9-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/Twisted-8.2.0-py2.4-linux-x86_64.egg', '/usr/local/lib64/python2.4/site-packages/enum-0.4.3-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/elementtree-1.2.7_20070827_preview-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/demjson-1.4-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/zope.interface-3.5.0-py2.4-linux-x86_64.egg', '/usr/local/lib64/python2.4/site-packages/cx_Oracle-5.0-py2.4-linux-x86_64.egg', '/usr/local/lib64/python2.4/site-packages/appirio2.gdocs-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio2.google-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio2.imap-1.0b-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio2.threads-1.0b.dev_r1309-py2.4.egg', '/usr/local/lib64/python2.4/site-packages/appirio2.util-1.0b.dev_r1427-py2.4.egg', '/usr/local/src/appirio.discovery', '/usr/lib/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/dbus', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/local/lib64/python2.4/site-packages']</td> </tr> <tr> <th>Server time:</th> <td>Tue, 6 Jan 2009 07:05:33 -0800</td> </tr> </table> </div> <div id="unicode-hint"> <h2>Unicode error hint</h2> <p>The string that could not be encoded/decoded was: <strong>=Y+��UUU</strong></p> </div> <div id="traceback"> <h2>Traceback <span class="commands"><a href="#" onclick="return switchPastebinFriendly(this);">Switch to copy-and-paste view</a></span></h2> <div id="browserTraceback"> <ul class="traceback"> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/core/handlers/base.py</code> in <code>get_response</code> <div class="context" id="c47662396356440"> <ol start="79" class="pre-context" id="pre47662396356440"><li onclick="toggle('pre47662396356440', 'post47662396356440')"> # Apply view middleware</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> for middleware_method in self._view_middleware:</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> response = middleware_method(request, callback, callback_args, callback_kwargs)</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> if response:</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> return response</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"></li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> try:</li></ol> <ol start="86" class="context-line"><li onclick="toggle('pre47662396356440', 'post47662396356440')"> response = callback(request, *callback_args, **callback_kwargs) <span>...</span></li></ol> <ol start='87' class="post-context" id="post47662396356440"><li onclick="toggle('pre47662396356440', 'post47662396356440')"> except Exception, e:</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> # If the view raised an exception, run it through exception</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> # middleware, and if the exception middleware returns a</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> # response, use that. Otherwise, reraise the exception.</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> for middleware_method in self._exception_middleware:</li><li onclick="toggle('pre47662396356440', 'post47662396356440')"> response = middleware_method(request, e)</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356440')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356440"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>callback</td> <td class="code"><div><function login at 0x2b594431be60></div></td> </tr> <tr> <td>callback_args</td> <td class="code"><div>()</div></td> </tr> <tr> <td>callback_kwargs</td> <td class="code"><div>{}</div></td> </tr> <tr> <td>e</td> <td class="code"><div><exceptions.UnicodeDecodeError instance at 0x2b5944343320></div></td> </tr> <tr> <td>exc_info</td> <td class="code"><div>(<class exceptions.UnicodeDecodeError at 0x2b593d9dfc50>, <exceptions.UnicodeDecodeError instance at 0x2b5944343320>, <traceback object at 0x2b5944343758>)</div></td> </tr> <tr> <td>exceptions</td> <td class="code"><div><module 'django.core.exceptions' from '/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/core/exceptions.pyc'></div></td> </tr> <tr> <td>middleware_method</td> <td class="code"><div><bound method XViewMiddleware.process_view of <django.middleware.doc.XViewMiddleware object at 0x2b5941fbd150>></div></td> </tr> <tr> <td>receivers</td> <td class="code"><div>[(<function _rollback_on_exception at 0x2b5943fa46e0>, None)]</div></td> </tr> <tr> <td>request</td> <td class="code"><div><ModPythonRequest path:/accounts/login/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'sessionid': '33c96f240174a0b7e67bd90ccf9b1764'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,*,utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,bzip2,sdch', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'sessionid=33c96f240174a0b7e67bd90ccf9b1764', 'HTTP_HOST': 'lablnx04', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19', 'PATH_INFO': u'/accounts/login/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '172.31.1.81', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '/edisco', 'SERVER_NAME': 'lablnx04.gene.com', 'SERVER_PORT': 0, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}></div></td> </tr> <tr> <td>resolver</td> <td class="code"><div><RegexURLResolver discovery.urls ^/></div></td> </tr> <tr> <td>response</td> <td class="code"><div>None</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.core.handlers.modpython.ModPythonHandler object at 0x2b5940d20e50></div></td> </tr> <tr> <td>settings</td> <td class="code"><div><django.conf.LazySettings object at 0x2b5941a3a410></div></td> </tr> <tr> <td>urlconf</td> <td class="code"><div>'discovery.urls'</div></td> </tr> <tr> <td>urlresolvers</td> <td class="code"><div><module 'django.core.urlresolvers' from '/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/core/urlresolvers.pyc'></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/views/decorators/cache.py</code> in <code>_wrapped_view_func</code> <div class="context" id="c47662396356368"> <ol start="37" class="pre-context" id="pre47662396356368"><li onclick="toggle('pre47662396356368', 'post47662396356368')"></li><li onclick="toggle('pre47662396356368', 'post47662396356368')">def never_cache(view_func):</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> """</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> Decorator that adds headers to a response so that it will</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> never be cached.</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> """</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> def _wrapped_view_func(request, *args, **kwargs):</li></ol> <ol start="44" class="context-line"><li onclick="toggle('pre47662396356368', 'post47662396356368')"> response = view_func(request, *args, **kwargs) <span>...</span></li></ol> <ol start='45' class="post-context" id="post47662396356368"><li onclick="toggle('pre47662396356368', 'post47662396356368')"> add_never_cache_headers(response)</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> return response</li><li onclick="toggle('pre47662396356368', 'post47662396356368')"> return wraps(view_func)(_wrapped_view_func)</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356368')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356368"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><div>()</div></td> </tr> <tr> <td>kwargs</td> <td class="code"><div>{}</div></td> </tr> <tr> <td>request</td> <td class="code"><div><ModPythonRequest path:/accounts/login/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'sessionid': '33c96f240174a0b7e67bd90ccf9b1764'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,*,utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,bzip2,sdch', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'sessionid=33c96f240174a0b7e67bd90ccf9b1764', 'HTTP_HOST': 'lablnx04', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19', 'PATH_INFO': u'/accounts/login/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '172.31.1.81', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '/edisco', 'SERVER_NAME': 'lablnx04.gene.com', 'SERVER_PORT': 0, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}></div></td> </tr> <tr> <td>view_func</td> <td class="code"><div><function login at 0x2b594431bde8></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/auth/views.py</code> in <code>login</code> <div class="context" id="c47662396356296"> <ol start="26" class="pre-context" id="pre47662396356296"><li onclick="toggle('pre47662396356296', 'post47662396356296')"> from django.contrib.auth import login</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> login(request, form.get_user())</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> if request.session.test_cookie_worked():</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> request.session.delete_test_cookie()</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> return HttpResponseRedirect(redirect_to)</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> else:</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> form = AuthenticationForm(request)</li></ol> <ol start="33" class="context-line"><li onclick="toggle('pre47662396356296', 'post47662396356296')"> request.session.set_test_cookie() <span>...</span></li></ol> <ol start='34' class="post-context" id="post47662396356296"><li onclick="toggle('pre47662396356296', 'post47662396356296')"> if Site._meta.installed:</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> current_site = Site.objects.get_current()</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> else:</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> current_site = RequestSite(request)</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> return render_to_response(template_name, {</li><li onclick="toggle('pre47662396356296', 'post47662396356296')"> 'form': form,</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356296')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356296"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>form</td> <td class="code"><div><django.contrib.auth.forms.AuthenticationForm object at 0x2b5944284810></div></td> </tr> <tr> <td>redirect_field_name</td> <td class="code"><div>'next'</div></td> </tr> <tr> <td>redirect_to</td> <td class="code"><div>''</div></td> </tr> <tr> <td>request</td> <td class="code"><div><ModPythonRequest path:/accounts/login/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'sessionid': '33c96f240174a0b7e67bd90ccf9b1764'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,*,utf-8', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,bzip2,sdch', 'HTTP_ACCEPT_LANGUAGE': 'en-US,en', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'sessionid=33c96f240174a0b7e67bd90ccf9b1764', 'HTTP_HOST': 'lablnx04', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19', 'PATH_INFO': u'/accounts/login/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '172.31.1.81', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '/edisco', 'SERVER_NAME': 'lablnx04.gene.com', 'SERVER_PORT': 0, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}></div></td> </tr> <tr> <td>template_name</td> <td class="code"><div>'registration/login.html'</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py</code> in <code>set_test_cookie</code> <div class="context" id="c47662395555496"> <ol start="71" class="pre-context" id="pre47662395555496"><li onclick="toggle('pre47662395555496', 'post47662395555496')"> return self._session[key]</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> else:</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> self.modified = True</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> self._session[key] = value</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> return value</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"></li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> def set_test_cookie(self):</li></ol> <ol start="78" class="context-line"><li onclick="toggle('pre47662395555496', 'post47662395555496')"> self[self.TEST_COOKIE_NAME] = self.TEST_COOKIE_VALUE <span>...</span></li></ol> <ol start='79' class="post-context" id="post47662395555496"><li onclick="toggle('pre47662395555496', 'post47662395555496')"></li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> def test_cookie_worked(self):</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> return self.get(self.TEST_COOKIE_NAME) == self.TEST_COOKIE_VALUE</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"></li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> def delete_test_cookie(self):</li><li onclick="toggle('pre47662395555496', 'post47662395555496')"> del self[self.TEST_COOKIE_NAME]</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662395555496')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662395555496"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>self</td> <td class="code"><div><django.contrib.sessions.backends.db.SessionStore object at 0x2b5941fd0090></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py</code> in <code>__setitem__</code> <div class="context" id="c47662395555568"> <ol start="42" class="pre-context" id="pre47662395555568"><li onclick="toggle('pre47662395555568', 'post47662395555568')"> def __contains__(self, key):</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> return key in self._session</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"></li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> def __getitem__(self, key):</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> return self._session[key]</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"></li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> def __setitem__(self, key, value):</li></ol> <ol start="49" class="context-line"><li onclick="toggle('pre47662395555568', 'post47662395555568')"> self._session[key] = value <span>...</span></li></ol> <ol start='50' class="post-context" id="post47662395555568"><li onclick="toggle('pre47662395555568', 'post47662395555568')"> self.modified = True</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"></li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> def __delitem__(self, key):</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> del self._session[key]</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"> self.modified = True</li><li onclick="toggle('pre47662395555568', 'post47662395555568')"></li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662395555568')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662395555568"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>key</td> <td class="code"><div>'testcookie'</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.contrib.sessions.backends.db.SessionStore object at 0x2b5941fd0090></div></td> </tr> <tr> <td>value</td> <td class="code"><div>'worked'</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py</code> in <code>_get_session</code> <div class="context" id="c47662396356224"> <ol start="165" class="pre-context" id="pre47662396356224"><li onclick="toggle('pre47662396356224', 'post47662396356224')"> self.accessed = True</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> try:</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> return self._session_cache</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> except AttributeError:</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> if self._session_key is None or no_load:</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> self._session_cache = {}</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> else:</li></ol> <ol start="172" class="context-line"><li onclick="toggle('pre47662396356224', 'post47662396356224')"> self._session_cache = self.load() <span>...</span></li></ol> <ol start='173' class="post-context" id="post47662396356224"><li onclick="toggle('pre47662396356224', 'post47662396356224')"> return self._session_cache</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"></li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> _session = property(_get_session)</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"></li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> def get_expiry_age(self):</li><li onclick="toggle('pre47662396356224', 'post47662396356224')"> """Get the number of seconds until the session expires."""</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356224')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356224"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>no_load</td> <td class="code"><div>False</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.contrib.sessions.backends.db.SessionStore object at 0x2b5941fd0090></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/db.py</code> in <code>load</code> <div class="context" id="c47662396356152"> <ol start="9" class="pre-context" id="pre47662396356152"><li onclick="toggle('pre47662396356152', 'post47662396356152')"> """</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> Implements database session store.</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> """</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> def load(self):</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> try:</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> s = Session.objects.get(</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> session_key = self.session_key,</li></ol> <ol start="16" class="context-line"><li onclick="toggle('pre47662396356152', 'post47662396356152')"> expire_date__gt=datetime.datetime.now() <span>...</span></li></ol> <ol start='17' class="post-context" id="post47662396356152"><li onclick="toggle('pre47662396356152', 'post47662396356152')"> )</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> return self.decode(force_unicode(s.session_data))</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> except (Session.DoesNotExist, SuspiciousOperation):</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> self.create()</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"> return {}</li><li onclick="toggle('pre47662396356152', 'post47662396356152')"></li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356152')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356152"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>self</td> <td class="code"><div><django.contrib.sessions.backends.db.SessionStore object at 0x2b5941fd0090></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/manager.py</code> in <code>get</code> <div class="context" id="c47662396356080"> <ol start="86" class="pre-context" id="pre47662396356080"><li onclick="toggle('pre47662396356080', 'post47662396356080')"> def distinct(self, *args, **kwargs):</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> return self.get_query_set().distinct(*args, **kwargs)</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"></li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> def extra(self, *args, **kwargs):</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> return self.get_query_set().extra(*args, **kwargs)</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"></li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> def get(self, *args, **kwargs):</li></ol> <ol start="93" class="context-line"><li onclick="toggle('pre47662396356080', 'post47662396356080')"> return self.get_query_set().get(*args, **kwargs) <span>...</span></li></ol> <ol start='94' class="post-context" id="post47662396356080"><li onclick="toggle('pre47662396356080', 'post47662396356080')"></li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> def get_or_create(self, **kwargs):</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> return self.get_query_set().get_or_create(**kwargs)</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"></li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> def create(self, **kwargs):</li><li onclick="toggle('pre47662396356080', 'post47662396356080')"> return self.get_query_set().create(**kwargs)</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356080')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356080"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><div>()</div></td> </tr> <tr> <td>kwargs</td> <td class="code"><div>{'expire_date__gt': datetime.datetime(2009, 1, 6, 7, 5, 33, 566372), 'session_key': '33c96f240174a0b7e67bd90ccf9b1764'}</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.contrib.sessions.models.SessionManager object at 0x2b594416fa50></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py</code> in <code>get</code> <div class="context" id="c47662396051328"> <ol start="297" class="pre-context" id="pre47662396051328"><li onclick="toggle('pre47662396051328', 'post47662396051328')"></li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> def get(self, *args, **kwargs):</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> """</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> Performs the query and returns a single object matching the given</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> keyword arguments.</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> """</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> clone = self.filter(*args, **kwargs)</li></ol> <ol start="304" class="context-line"><li onclick="toggle('pre47662396051328', 'post47662396051328')"> num = len(clone) <span>...</span></li></ol> <ol start='305' class="post-context" id="post47662396051328"><li onclick="toggle('pre47662396051328', 'post47662396051328')"> if num == 1:</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> return clone._result_cache[0]</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> if not num:</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> raise self.model.DoesNotExist("%s matching query does not exist."</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> % self.model._meta.object_name)</li><li onclick="toggle('pre47662396051328', 'post47662396051328')"> raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396051328')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396051328"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><div>()</div></td> </tr> <tr> <td>clone</td> <td class="code"><div>[<Session: Session object>]</div></td> </tr> <tr> <td>kwargs</td> <td class="code"><div>{'expire_date__gt': datetime.datetime(2009, 1, 6, 7, 5, 33, 566372), 'session_key': '33c96f240174a0b7e67bd90ccf9b1764'}</div></td> </tr> <tr> <td>self</td> <td class="code"><div>[<Session: Session object>, <Session: Session object>, <Session: Session object>, <Session: Session object>, <Session: Session object>]</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py</code> in <code>__len__</code> <div class="context" id="c47662396050968"> <ol start="153" class="pre-context" id="pre47662396050968"><li onclick="toggle('pre47662396050968', 'post47662396050968')"> # Since __len__ is called quite frequently (for example, as part of</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> # list(qs), we make some effort here to be as efficient as possible</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> # whilst not messing up any existing iterators against the QuerySet.</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> if self._result_cache is None:</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> if self._iter:</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> self._result_cache = list(self._iter)</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> else:</li></ol> <ol start="160" class="context-line"><li onclick="toggle('pre47662396050968', 'post47662396050968')"> self._result_cache = list(self.iterator()) <span>...</span></li></ol> <ol start='161' class="post-context" id="post47662396050968"><li onclick="toggle('pre47662396050968', 'post47662396050968')"> elif self._iter:</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> self._result_cache.extend(list(self._iter))</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> return len(self._result_cache)</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"></li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> def __iter__(self):</li><li onclick="toggle('pre47662396050968', 'post47662396050968')"> if self._result_cache is None:</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396050968')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396050968"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>self</td> <td class="code"><div>[<Session: Session object>]</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py</code> in <code>iterator</code> <div class="context" id="c47662396356008"> <ol start="268" class="pre-context" id="pre47662396356008"><li onclick="toggle('pre47662396356008', 'post47662396356008')"> if isinstance(fill_cache, dict):</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> requested = fill_cache</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> else:</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> requested = None</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> max_depth = self.query.max_depth</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> extra_select = self.query.extra_select.keys()</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> index_start = len(extra_select)</li></ol> <ol start="275" class="context-line"><li onclick="toggle('pre47662396356008', 'post47662396356008')"> for row in self.query.results_iter(): <span>...</span></li></ol> <ol start='276' class="post-context" id="post47662396356008"><li onclick="toggle('pre47662396356008', 'post47662396356008')"> if fill_cache:</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> obj, _ = get_cached_row(self.model, row, index_start,</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> max_depth, requested=requested)</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> else:</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> obj = self.model(*row[index_start:])</li><li onclick="toggle('pre47662396356008', 'post47662396356008')"> for i, k in enumerate(extra_select):</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396356008')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396356008"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>extra_select</td> <td class="code"><div>[]</div></td> </tr> <tr> <td>fill_cache</td> <td class="code"><div>False</div></td> </tr> <tr> <td>index_start</td> <td class="code"><div>0</div></td> </tr> <tr> <td>max_depth</td> <td class="code"><div>5</div></td> </tr> <tr> <td>requested</td> <td class="code"><div>None</div></td> </tr> <tr> <td>self</td> <td class="code"><div>[<Session: Session object>]</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/sql/query.py</code> in <code>results_iter</code> <div class="context" id="c47662396355216"> <ol start="210" class="pre-context" id="pre47662396355216"><li onclick="toggle('pre47662396355216', 'post47662396355216')"> # We only set this up here because</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> # related_select_fields isn't populated until</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> # execute_sql() has been called.</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> if self.select_fields:</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> fields = self.select_fields + self.related_select_fields</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> else:</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> fields = self.model._meta.fields</li></ol> <ol start="217" class="context-line"><li onclick="toggle('pre47662396355216', 'post47662396355216')"> row = self.resolve_columns(row, fields) <span>...</span></li></ol> <ol start='218' class="post-context" id="post47662396355216"><li onclick="toggle('pre47662396355216', 'post47662396355216')"> yield row</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"></li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> def get_count(self):</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> """</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> Performs a COUNT() query using the current filter constraints.</li><li onclick="toggle('pre47662396355216', 'post47662396355216')"> """</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396355216')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396355216"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>fields</td> <td class="code"><div>[<django.db.models.fields.CharField object at 0x2b5941fd0610>, <django.db.models.fields.TextField object at 0x2b5944168950>, <django.db.models.fields.DateTimeField object at 0x2b594416fa10>]</div></td> </tr> <tr> <td>resolve_columns</td> <td class="code"><div>True</div></td> </tr> <tr> <td>row</td> <td class="code"><div>(u'33c96f240174a0b7e67bd90ccf9b1764', <cx_Oracle.LOB object at 0x2b593da1e6f0>, datetime.datetime(2009, 1, 20, 6, 59, 17, 672334))</div></td> </tr> <tr> <td>rows</td> <td class="code"><div>((u'33c96f240174a0b7e67bd90ccf9b1764', <cx_Oracle.LOB object at 0x2b593da1e6f0>, datetime.datetime(2009, 1, 20, 6, 59, 17, 672334)),)</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.db.backends.oracle.query.OracleQuery object at 0x2b594431c490></div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py</code> in <code>resolve_columns</code> <div class="context" id="c47662396355864"> <ol start="45" class="pre-context" id="pre47662396355864"><li onclick="toggle('pre47662396355864', 'post47662396355864')"> rn_offset = 1</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> else:</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> rn_offset = 0</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> index_start = rn_offset + len(self.extra_select.keys())</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> values = [self.convert_values(v, None)</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> for v in row[rn_offset:index_start]]</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> for value, field in map(None, row[index_start:], fields):</li></ol> <ol start="52" class="context-line"><li onclick="toggle('pre47662396355864', 'post47662396355864')"> values.append(self.convert_values(value, field)) <span>...</span></li></ol> <ol start='53' class="post-context" id="post47662396355864"><li onclick="toggle('pre47662396355864', 'post47662396355864')"> return values</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"></li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> def convert_values(self, value, field):</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> from django.db.models.fields import DateField, DateTimeField, \</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> TimeField, BooleanField, NullBooleanField, DecimalField, Field</li><li onclick="toggle('pre47662396355864', 'post47662396355864')"> if isinstance(value, Database.LOB):</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396355864')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396355864"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>field</td> <td class="code"><div><django.db.models.fields.TextField object at 0x2b5944168950></div></td> </tr> <tr> <td>fields</td> <td class="code"><div>[<django.db.models.fields.CharField object at 0x2b5941fd0610>, <django.db.models.fields.TextField object at 0x2b5944168950>, <django.db.models.fields.DateTimeField object at 0x2b594416fa10>]</div></td> </tr> <tr> <td>index_start</td> <td class="code"><div>0</div></td> </tr> <tr> <td>rn_offset</td> <td class="code"><div>0</div></td> </tr> <tr> <td>row</td> <td class="code"><div>(u'33c96f240174a0b7e67bd90ccf9b1764', <cx_Oracle.LOB object at 0x2b593da1e6f0>, datetime.datetime(2009, 1, 20, 6, 59, 17, 672334))</div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.db.backends.oracle.query.OracleQuery object at 0x2b594431c490></div></td> </tr> <tr> <td>value</td> <td class="code"><div><cx_Oracle.LOB object at 0x2b593da1e6f0></div></td> </tr> <tr> <td>values</td> <td class="code"><div>[u'33c96f240174a0b7e67bd90ccf9b1764']</div></td> </tr> </tbody> </table> </li> <li class="frame"> <code>/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py</code> in <code>convert_values</code> <div class="context" id="c47662396355936"> <ol start="52" class="pre-context" id="pre47662396355936"><li onclick="toggle('pre47662396355936', 'post47662396355936')"> values.append(self.convert_values(value, field))</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> return values</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"></li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> def convert_values(self, value, field):</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> from django.db.models.fields import DateField, DateTimeField, \</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> TimeField, BooleanField, NullBooleanField, DecimalField, Field</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> if isinstance(value, Database.LOB):</li></ol> <ol start="59" class="context-line"><li onclick="toggle('pre47662396355936', 'post47662396355936')"> value = value.read() <span>...</span></li></ol> <ol start='60' class="post-context" id="post47662396355936"><li onclick="toggle('pre47662396355936', 'post47662396355936')"> # Oracle stores empty strings as null. We need to undo this in</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> # order to adhere to the Django convention of using the empty</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> # string instead of null, but only if the field accepts the</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> # empty string.</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> if value is None and isinstance(field, Field) and field.empty_strings_allowed:</li><li onclick="toggle('pre47662396355936', 'post47662396355936')"> value = u''</li></ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '47662396355936')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v47662396355936"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>BooleanField</td> <td class="code"><div><class 'django.db.models.fields.BooleanField'></div></td> </tr> <tr> <td>Database</td> <td class="code"><div><module 'cx_Oracle' from '/tmp/cx_Oracle-5.0-py2.4-linux-x86_64.egg-tmp/cx_Oracle.so'></div></td> </tr> <tr> <td>DateField</td> <td class="code"><div><class 'django.db.models.fields.DateField'></div></td> </tr> <tr> <td>DateTimeField</td> <td class="code"><div><class 'django.db.models.fields.DateTimeField'></div></td> </tr> <tr> <td>DecimalField</td> <td class="code"><div><class 'django.db.models.fields.DecimalField'></div></td> </tr> <tr> <td>Field</td> <td class="code"><div><class 'django.db.models.fields.Field'></div></td> </tr> <tr> <td>NullBooleanField</td> <td class="code"><div><class 'django.db.models.fields.NullBooleanField'></div></td> </tr> <tr> <td>TimeField</td> <td class="code"><div><class 'django.db.models.fields.TimeField'></div></td> </tr> <tr> <td>field</td> <td class="code"><div><django.db.models.fields.TextField object at 0x2b5944168950></div></td> </tr> <tr> <td>self</td> <td class="code"><div><django.db.backends.oracle.query.OracleQuery object at 0x2b594431c490></div></td> </tr> <tr> <td>value</td> <td class="code"><div><cx_Oracle.LOB object at 0x2b593da1e6f0></div></td> </tr> </tbody> </table> </li> </ul> </div> <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post"> <div id="pastebinTraceback" class="pastebin"> <input type="hidden" name="language" value="PythonConsole"> <input type="hidden" name="title" value="UnicodeDecodeError at /accounts/login/"> <input type="hidden" name="source" value="Django Dpaste Agent"> <input type="hidden" name="poster" value="Django"> <textarea name="content" id="traceback_area" cols="140" rows="25"> Environment: Request Method: GET Request URL: http://lablnx04/accounts/login/ Django Version: 1.0.2 final Python Version: 2.4.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'discovery.edisco'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware') Traceback: File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/core/handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/auth/views.py" in login 33. request.session.set_test_cookie() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in set_test_cookie 78. self[self.TEST_COOKIE_NAME] = self.TEST_COOKIE_VALUE File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in __setitem__ 49. self._session[key] = value File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in _get_session 172. self._session_cache = self.load() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/db.py" in load 16. expire_date__gt=datetime.datetime.now() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/manager.py" in get 93. return self.get_query_set().get(*args, **kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in get 304. num = len(clone) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in __len__ 160. self._result_cache = list(self.iterator()) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in iterator 275. for row in self.query.results_iter(): File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/sql/query.py" in results_iter 217. row = self.resolve_columns(row, fields) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py" in resolve_columns 52. values.append(self.convert_values(value, field)) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py" in convert_values 59. value = value.read() Exception Type: UnicodeDecodeError at /accounts/login/ Exception Value: 'utf16' codec can't decode bytes in position 120-121: illegal UTF-16 surrogate </textarea> <br><br> <input type="submit" value="Share this traceback on a public Web site"> </div> </form> </div> <div id="requestinfo"> <h2>Request information</h2> <h3 id="get-info">GET</h3> <p>No GET data</p> <h3 id="post-info">POST</h3> <p>No POST data</p> <h3 id="cookie-info">COOKIES</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>sessionid</td> <td class="code"><div>'33c96f240174a0b7e67bd90ccf9b1764'</div></td> </tr> </tbody> </table> <h3 id="meta-info">META</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>AUTH_TYPE</td> <td class="code"><div>None</div></td> </tr> <tr> <td>CONTENT_LENGTH</td> <td class="code"><div>0L</div></td> </tr> <tr> <td>CONTENT_TYPE</td> <td class="code"><div>None</div></td> </tr> <tr> <td>GATEWAY_INTERFACE</td> <td class="code"><div>'CGI/1.1'</div></td> </tr> <tr> <td>HTTP_ACCEPT</td> <td class="code"><div>'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'</div></td> </tr> <tr> <td>HTTP_ACCEPT_CHARSET</td> <td class="code"><div>'ISO-8859-1,*,utf-8'</div></td> </tr> <tr> <td>HTTP_ACCEPT_ENCODING</td> <td class="code"><div>'gzip,deflate,bzip2,sdch'</div></td> </tr> <tr> <td>HTTP_ACCEPT_LANGUAGE</td> <td class="code"><div>'en-US,en'</div></td> </tr> <tr> <td>HTTP_CACHE_CONTROL</td> <td class="code"><div>'max-age=0'</div></td> </tr> <tr> <td>HTTP_CONNECTION</td> <td class="code"><div>'Keep-Alive'</div></td> </tr> <tr> <td>HTTP_COOKIE</td> <td class="code"><div>'sessionid=33c96f240174a0b7e67bd90ccf9b1764'</div></td> </tr> <tr> <td>HTTP_HOST</td> <td class="code"><div>'lablnx04'</div></td> </tr> <tr> <td>HTTP_USER_AGENT</td> <td class="code"><div>'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19'</div></td> </tr> <tr> <td>PATH_INFO</td> <td class="code"><div>u'/accounts/login/'</div></td> </tr> <tr> <td>PATH_TRANSLATED</td> <td class="code"><div>None</div></td> </tr> <tr> <td>QUERY_STRING</td> <td class="code"><div>None</div></td> </tr> <tr> <td>REMOTE_ADDR</td> <td class="code"><div>'172.31.1.81'</div></td> </tr> <tr> <td>REMOTE_HOST</td> <td class="code"><div>None</div></td> </tr> <tr> <td>REMOTE_IDENT</td> <td class="code"><div>None</div></td> </tr> <tr> <td>REMOTE_USER</td> <td class="code"><div>None</div></td> </tr> <tr> <td>REQUEST_METHOD</td> <td class="code"><div>'GET'</div></td> </tr> <tr> <td>SCRIPT_NAME</td> <td class="code"><div>'/edisco'</div></td> </tr> <tr> <td>SERVER_NAME</td> <td class="code"><div>'lablnx04.gene.com'</div></td> </tr> <tr> <td>SERVER_PORT</td> <td class="code"><div>0</div></td> </tr> <tr> <td>SERVER_PROTOCOL</td> <td class="code"><div>'HTTP/1.1'</div></td> </tr> <tr> <td>SERVER_SOFTWARE</td> <td class="code"><div>'mod_python'</div></td> </tr> </tbody> </table> <h3 id="settings-info">Settings</h3> <h4>Using settings module <code>discovery.settings</code></h4> <table class="req"> <thead> <tr> <th>Setting</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ABSOLUTE_URL_OVERRIDES</td> <td class="code"><div>{}</div></td> </tr> <tr> <td>ADMINS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>ADMIN_FOR</td> <td class="code"><div>()</div></td> </tr> <tr> <td>ADMIN_MEDIA_PREFIX</td> <td class="code"><div>'/media/'</div></td> </tr> <tr> <td>ALLOWED_INCLUDE_ROOTS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>APPEND_SLASH</td> <td class="code"><div>True</div></td> </tr> <tr> <td>AUTHENTICATION_BACKENDS</td> <td class="code"><div>('django.contrib.auth.backends.ModelBackend', 'discovery.ldap_backend.LDAPBackend')</div></td> </tr> <tr> <td>BANNED_IPS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>CACHE_BACKEND</td> <td class="code"><div>'locmem://'</div></td> </tr> <tr> <td>CACHE_MIDDLEWARE_KEY_PREFIX</td> <td class="code"><div>''</div></td> </tr> <tr> <td>CACHE_MIDDLEWARE_SECONDS</td> <td class="code"><div>600</div></td> </tr> <tr> <td>COMMENTS_ALLOW_PROFANITIES</td> <td class="code"><div>False</div></td> </tr> <tr> <td>COMMENTS_BANNED_USERS_GROUP</td> <td class="code"><div>None</div></td> </tr> <tr> <td>COMMENTS_FIRST_FEW</td> <td class="code"><div>0</div></td> </tr> <tr> <td>COMMENTS_MODERATORS_GROUP</td> <td class="code"><div>None</div></td> </tr> <tr> <td>COMMENTS_SKETCHY_USERS_GROUP</td> <td class="code"><div>None</div></td> </tr> <tr> <td>DATABASE_ENGINE</td> <td class="code"><div>'oracle'</div></td> </tr> <tr> <td>DATABASE_HOST</td> <td class="code"><div>'citd4.gene.com'</div></td> </tr> <tr> <td>DATABASE_NAME</td> <td class="code"><div>'citd4'</div></td> </tr> <tr> <td>DATABASE_OPTIONS</td> <td class="code"><div>{}</div></td> </tr> <tr> <td>DATABASE_PASSWORD</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>DATABASE_PORT</td> <td class="code"><div>'50047'</div></td> </tr> <tr> <td>DATABASE_USER</td> <td class="code"><div>'mail_discovery'</div></td> </tr> <tr> <td>DATETIME_FORMAT</td> <td class="code"><div>'N j, Y, P'</div></td> </tr> <tr> <td>DATE_FORMAT</td> <td class="code"><div>'N j, Y'</div></td> </tr> <tr> <td>DEBUG</td> <td class="code"><div>True</div></td> </tr> <tr> <td>DEBUG_PROPAGATE_EXCEPTIONS</td> <td class="code"><div>False</div></td> </tr> <tr> <td>DEFAULT_CHARSET</td> <td class="code"><div>'utf-8'</div></td> </tr> <tr> <td>DEFAULT_CONTENT_TYPE</td> <td class="code"><div>'text/html'</div></td> </tr> <tr> <td>DEFAULT_FILE_STORAGE</td> <td class="code"><div>'django.core.files.storage.FileSystemStorage'</div></td> </tr> <tr> <td>DEFAULT_FROM_EMAIL</td> <td class="code"><div>'webmaster@localhost'</div></td> </tr> <tr> <td>DEFAULT_INDEX_TABLESPACE</td> <td class="code"><div>''</div></td> </tr> <tr> <td>DEFAULT_TABLESPACE</td> <td class="code"><div>''</div></td> </tr> <tr> <td>DISALLOWED_USER_AGENTS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>EMAIL_HOST</td> <td class="code"><div>'localhost'</div></td> </tr> <tr> <td>EMAIL_HOST_PASSWORD</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>EMAIL_HOST_USER</td> <td class="code"><div>''</div></td> </tr> <tr> <td>EMAIL_PORT</td> <td class="code"><div>25</div></td> </tr> <tr> <td>EMAIL_SUBJECT_PREFIX</td> <td class="code"><div>'[Django] '</div></td> </tr> <tr> <td>EMAIL_USE_TLS</td> <td class="code"><div>False</div></td> </tr> <tr> <td>FILE_CHARSET</td> <td class="code"><div>'utf-8'</div></td> </tr> <tr> <td>FILE_UPLOAD_HANDLERS</td> <td class="code"><div>('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler')</div></td> </tr> <tr> <td>FILE_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><div>2621440</div></td> </tr> <tr> <td>FILE_UPLOAD_PERMISSIONS</td> <td class="code"><div>None</div></td> </tr> <tr> <td>FILE_UPLOAD_TEMP_DIR</td> <td class="code"><div>None</div></td> </tr> <tr> <td>FIXTURE_DIRS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>FORCE_SCRIPT_NAME</td> <td class="code"><div>None</div></td> </tr> <tr> <td>GOOGLE_ADMIN_EMAIL</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>GOOGLE_ADMIN_PASSWORD</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>GOOGLE_ADMIN_USERNAME</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>GOOGLE_DOMAIN</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>GOOGLE_IMAP_HOSTNAME</td> <td class="code"><div>'imap.gmail.com'</div></td> </tr> <tr> <td>GOOGLE_SMTP_HOSTNAME</td> <td class="code"><div>'smtp.gmail.com'</div></td> </tr> <tr> <td>GOOGLE_SMTP_PASSWORD</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>GOOGLE_SMTP_PORT</td> <td class="code"><div>587</div></td> </tr> <tr> <td>GOOGLE_SMTP_TLS</td> <td class="code"><div>True</div></td> </tr> <tr> <td>GOOGLE_SMTP_USERNAME</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>IGNORABLE_404_ENDS</td> <td class="code"><div>('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')</div></td> </tr> <tr> <td>IGNORABLE_404_STARTS</td> <td class="code"><div>('/cgi-bin/', '/_vti_bin', '/_vti_inf')</div></td> </tr> <tr> <td>INSTALLED_APPS</td> <td class="code"><div>['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'discovery.edisco']</div></td> </tr> <tr> <td>INTERNAL_IPS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>JING_PATH</td> <td class="code"><div>'/usr/bin/jing'</div></td> </tr> <tr> <td>LANGUAGES</td> <td class="code"><div>(('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('et', 'Estonian'), ('es-ar', 'Argentinean Spanish'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('ga', 'Irish'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('ko', 'Korean'), ('km', 'Khmer'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('lt', 'Lithuanian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese'))</div></td> </tr> <tr> <td>LANGUAGES_BIDI</td> <td class="code"><div>('he', 'ar', 'fa')</div></td> </tr> <tr> <td>LANGUAGE_CODE</td> <td class="code"><div>'en-us'</div></td> </tr> <tr> <td>LANGUAGE_COOKIE_NAME</td> <td class="code"><div>'django_language'</div></td> </tr> <tr> <td>LDAP_BASE</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>LDAP_SERVER</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>LOCALE_PATHS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>LOGIN_REDIRECT_URL</td> <td class="code"><div>'/accounts/profile/'</div></td> </tr> <tr> <td>LOGIN_URL</td> <td class="code"><div>'/accounts/login/'</div></td> </tr> <tr> <td>LOGOUT_URL</td> <td class="code"><div>'/accounts/logout/'</div></td> </tr> <tr> <td>MANAGERS</td> <td class="code"><div>()</div></td> </tr> <tr> <td>MEDIA_ROOT</td> <td class="code"><div>''</div></td> </tr> <tr> <td>MEDIA_URL</td> <td class="code"><div>''</div></td> </tr> <tr> <td>MIDDLEWARE_CLASSES</td> <td class="code"><div>('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware')</div></td> </tr> <tr> <td>MONTH_DAY_FORMAT</td> <td class="code"><div>'F j'</div></td> </tr> <tr> <td>PASSWORD_RESET_TIMEOUT_DAYS</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>PREPEND_WWW</td> <td class="code"><div>False</div></td> </tr> <tr> <td>PROFANITIES_LIST</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>ROOT_URLCONF</td> <td class="code"><div>'discovery.urls'</div></td> </tr> <tr> <td>SECRET_KEY</td> <td class="code"><div>'********************'</div></td> </tr> <tr> <td>SEND_BROKEN_LINK_EMAILS</td> <td class="code"><div>False</div></td> </tr> <tr> <td>SERVER_EMAIL</td> <td class="code"><div>'root@localhost'</div></td> </tr> <tr> <td>SESSION_COOKIE_AGE</td> <td class="code"><div>1209600</div></td> </tr> <tr> <td>SESSION_COOKIE_DOMAIN</td> <td class="code"><div>None</div></td> </tr> <tr> <td>SESSION_COOKIE_NAME</td> <td class="code"><div>'sessionid'</div></td> </tr> <tr> <td>SESSION_COOKIE_PATH</td> <td class="code"><div>'/'</div></td> </tr> <tr> <td>SESSION_COOKIE_SECURE</td> <td class="code"><div>False</div></td> </tr> <tr> <td>SESSION_ENGINE</td> <td class="code"><div>'django.contrib.sessions.backends.db'</div></td> </tr> <tr> <td>SESSION_EXPIRE_AT_BROWSER_CLOSE</td> <td class="code"><div>False</div></td> </tr> <tr> <td>SESSION_FILE_PATH</td> <td class="code"><div>None</div></td> </tr> <tr> <td>SESSION_SAVE_EVERY_REQUEST</td> <td class="code"><div>False</div></td> </tr> <tr> <td>SETTINGS_MODULE</td> <td class="code"><div>'discovery.settings'</div></td> </tr> <tr> <td>SITE_ID</td> <td class="code"><div>1</div></td> </tr> <tr> <td>TEMPLATE_CONTEXT_PROCESSORS</td> <td class="code"><div>('django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media')</div></td> </tr> <tr> <td>TEMPLATE_DEBUG</td> <td class="code"><div>True</div></td> </tr> <tr> <td>TEMPLATE_DIRS</td> <td class="code"><div>('/usr/local/web/edisco/templates',)</div></td> </tr> <tr> <td>TEMPLATE_LOADERS</td> <td class="code"><div>('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source')</div></td> </tr> <tr> <td>TEMPLATE_STRING_IF_INVALID</td> <td class="code"><div>''</div></td> </tr> <tr> <td>TEST_DATABASE_CHARSET</td> <td class="code"><div>None</div></td> </tr> <tr> <td>TEST_DATABASE_COLLATION</td> <td class="code"><div>None</div></td> </tr> <tr> <td>TEST_DATABASE_NAME</td> <td class="code"><div>None</div></td> </tr> <tr> <td>TEST_RUNNER</td> <td class="code"><div>'django.test.simple.run_tests'</div></td> </tr> <tr> <td>TIME_FORMAT</td> <td class="code"><div>'P'</div></td> </tr> <tr> <td>TIME_ZONE</td> <td class="code"><div>'PST8PDT'</div></td> </tr> <tr> <td>TRANSACTIONS_MANAGED</td> <td class="code"><div>False</div></td> </tr> <tr> <td>URL_VALIDATOR_USER_AGENT</td> <td class="code"><div>'Django/1.0.2 final (http://www.djangoproject.com)'</div></td> </tr> <tr> <td>USE_ETAGS</td> <td class="code"><div>False</div></td> </tr> <tr> <td>USE_I18N</td> <td class="code"><div>False</div></td> </tr> <tr> <td>YEAR_MONTH_FORMAT</td> <td class="code"><div>'F Y'</div></td> </tr> </tbody> </table> </div> <div id="explanation"> <p> You're seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard 500 page. </p> </div> </body> </html>
comment:3 by , 16 years ago
Egads, I'm guessing you did not preview what that looked like before submitting it? The debug page has a "switch-to-cut-and-paste" link that is useful for extracting just the traceback instead of the 90K/2,000 lines of the html that makes up the debug page. Using it to get just the traceback from that html:
Environment: Request Method: GET Request URL: http://lablnx04/accounts/login/ Django Version: 1.0.2 final Python Version: 2.4.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'discovery.edisco'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware') Traceback: File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/core/handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/auth/views.py" in login 33. request.session.set_test_cookie() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in set_test_cookie 78. self[self.TEST_COOKIE_NAME] = self.TEST_COOKIE_VALUE File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in __setitem__ 49. self._session[key] = value File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/base.py" in _get_session 172. self._session_cache = self.load() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/contrib/sessions/backends/db.py" in load 16. expire_date__gt=datetime.datetime.now() File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/manager.py" in get 93. return self.get_query_set().get(*args, **kwargs) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in get 304. num = len(clone) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in __len__ 160. self._result_cache = list(self.iterator()) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/query.py" in iterator 275. for row in self.query.results_iter(): File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/models/sql/query.py" in results_iter 217. row = self.resolve_columns(row, fields) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py" in resolve_columns 52. values.append(self.convert_values(value, field)) File "/usr/local/lib64/python2.4/site-packages/Django-1.0.2_final-py2.4.egg/django/db/backends/oracle/query.py" in convert_values 59. value = value.read() Exception Type: UnicodeDecodeError at /accounts/login/ Exception Value: 'utf16' codec can't decode bytes in position 120-121: illegal UTF-16 surrogate
It's similar but not quite the same. Still have no clue what is going on in these error situations because I cannot recreate any problem on my own Oracle setup, and my knowedge of Oracle is just above zero (I was able to set it up for testing purposes, but I have not used it beyond that).
follow-up: 6 comment:4 by , 16 years ago
What version of cx_Oracle is being used in these setups? My hope is that this is occurring with cx_Oracle 5.0, in which case the solution is easy: don't use that. cx_Oracle 5.0 has a known NCLOB decoding bug that makes it unusable for Django (I suppose we should document this). cx_Oracle trunk and the upcoming 5.0.1 release should be okay, as is the 4.4.1 release.
If you're not using cx_Oracle 5.0, let me know so we can investigate further.
comment:5 by , 16 years ago
comment:6 by , 16 years ago
Replying to ikelly:
What version of cx_Oracle is being used in these setups? My hope is that this is occurring with cx_Oracle 5.0, in which case the solution is easy: don't use that. cx_Oracle 5.0 has a known NCLOB decoding bug that makes it unusable for Django (I suppose we should document this). cx_Oracle trunk and the upcoming 5.0.1 release should be okay, as is the 4.4.1 release.
If you're not using cx_Oracle 5.0, let me know so we can investigate further.
Indeed, I was using version 5.0. Will try version 4.4.1 later.
comment:7 by , 16 years ago
I can confirm that cx_oracle 4.4.1 works fine (at least I didn't run into the problem I reported here).
comment:8 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This seems to be caused by the cx_Oracle 5.0 NCLOB bug, which is severe enough that there's really nothing we can do about it now but wait for the next release.
follow-up: 11 comment:10 by , 14 years ago
Cc: | added |
---|
I can reproduce this bug in cx_Oracle 5.0.4 and Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production.
Downgrading to cx_Oracle 4.4.1 solves the problem.
comment:11 by , 14 years ago
Replying to Goldan:
I can reproduce this bug in cx_Oracle 5.0.4 and Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production.
Downgrading to cx_Oracle 4.4.1 solves the problem.
This ticket is ancient, and it's more likely that you're actually running into some other encoding bug than the one that was diagnosed here. Please create a new ticket for your report, and please include the traceback that you get as well.
Thanks,
Ian
(Fixed formatting.)
FWIW, this is not generally re-creatable. I've got Oracle 10g XE on a Windows box with Python 2.5.2 and have no trouble using using the admin interface with that setup. I suspect the problem may be some configuration issue but I don't know enough about Oracle or contrib.sessions to say what might be going wrong in your case.