danielkleinert/Praktomat — Issue #129: get_unicode TypeError: expected string or buffer
Author: mhecker
Created: 2011-11-08 10:07:17+00:00
State: open

Traceback (most recent call last):

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/db/transaction.py", line 217, in inner
res = func(*args, **kwargs)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/views/decorators/cache.py", line 66, in _cache_controlled
response = viewfunc(request, *args, **kw)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/solutions/views.py", line 47, in solution_list
solution.check(run_all_checker)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/solutions/models.py", line 58, in check
check(self, run_secret)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/checker/models.py", line 205, in check
env = CheckerEnvironment(solution)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/checker/models.py", line 121, in __init__
self._sources.append((file.path(),file.content()))

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/solutions/models.py", line 163, in content
return encoding.get_unicode(self.file.read())

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/utilities/encoding.py", line 8, in get_unicode
return bytestring.decode(re.sub(r"ISO-8859-[0-9]","ISO-8859-1",chardet.detect(bytestring)["encoding"]))

File "/data1/praktomat/python2.7.1/lib/python2.7/re.py", line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)

TypeError: expected string or buffer

,
POST:,
COOKIES:{'csrftoken_praktomat_2011_WS': '3fdebb5504716931b90604737a123775',
'phpbb3_mqh4e_k': '',
'phpbb3_mqh4e_sid': '0eaeec3ef287c91ee0dc69f9739b450a',
'phpbb3_mqh4e_u': '1',
'sessionid': '71238b56710dda39a1663a14682c1d06',
'style_cookie': 'null'},
META:{'CONTENT_LENGTH': '3011',
'CONTENT_TYPE': 'multipart/form-data; boundary=---------------------------41184676334',
'CSRF_COOKIE': '3fdebb5504716931b90604737a123775',
'DOCUMENT_ROOT': '/praktomat/www',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTPS': '1',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_COOKIE': 'sessionid=71238b56710dda39a1663a14682c1d06; phpbb3_mqh4e_u=1; phpbb3_mqh4e_k=; phpbb3_mqh4e_sid=0eaeec3ef287c91ee0dc69f9739b450a; style_cookie=null; csrftoken_praktomat_2011_WS=3fdebb5504716931b90604737a123775',
'HTTP_HOST': 'praktomat.info.uni-karlsruhe.de',
'HTTP_REFERER': 'https://praktomat.info.uni-karlsruhe.de/praktomat_2011_WS/tasks/2/solutionupload/',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2',
'PATH_INFO': u'/tasks/2/solutionupload/',
'PATH_TRANSLATED': '/praktomat/www/tasks/2/solutionupload/',
'QUERY_STRING': '',
'REMOTE_ADDR': '141.3.193.63',
'REMOTE_HOST': 'vpn-cl-193-63.scc.kit.edu',
'REMOTE_PORT': '53762',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/praktomat_2011_WS/tasks/2/solutionupload/',
'SCRIPT_FILENAME': '/praktomatng/installations/praktomat_2011_WS/Praktomat/bin/praktomat.wsgi',
'SCRIPT_NAME': u'/praktomat_2011_WS',
'SCRIPT_URI': 'https://praktomat.info.uni-karlsruhe.de/praktomat_2011_WS/tasks/2/solutionupload/',
'SCRIPT_URL': '/praktomat_2011_WS/tasks/2/solutionupload/',
'SERVER_ADDR': '172.22.85.243',
'SERVER_ADMIN': 'praktomat@ipd.info.uni-karlsruhe.de',
'SERVER_NAME': 'praktomat.info.uni-karlsruhe.de',
'SERVER_PORT': '443',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SIGNATURE': '

Apache/2.2.8 (Ubuntu) mod_auth_pgsql/2.0.3 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_wsgi/3.3 Python/2.7.1 Server at praktomat.info.uni-karlsruhe.de Port 443

\n',
'SERVER_SOFTWARE': 'Apache/2.2.8 (Ubuntu) mod_auth_pgsql/2.0.3 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_wsgi/3.3 Python/2.7.1',
'mod_wsgi.application_group': 'i44sun3.info.uni-karlsruhe.de|/praktomat_2011_ws',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.handler_script': '',
'mod_wsgi.input_chunked': '0',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '443',
'mod_wsgi.process_group': 'praktomat2',
'mod_wsgi.request_handler': 'wsgi-script',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (3, 3),
'wsgi.errors': ,
'wsgi.file_wrapper': ,
'wsgi.input': ,
'wsgi.multiprocess': False,
'wsgi.multithread': True,
'wsgi.run_once': False,
'wsgi.url_scheme': 'https',
'wsgi.version': (1, 1)}>