danielkleinert/Praktomat — Issue #127: _get_upload_path unicode problem
Author: danielkleinert
Created: 2011-11-06 13:17:10+00:00
State: open
Labels: Encoding

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 45, in solution_list
formset.save()

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/forms/models.py", line 482, in save
return self.save_existing_objects(commit) + self.save_new_objects(commit)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/forms/models.py", line 613, in save_new_objects
self.new_objects.append(self.save_new(form, commit=commit))

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/forms/models.py", line 717, in save_new
obj.save()

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/solutions/models.py", line 131, in save
new_solution_file.file.save(zip_file_name, File(temp_file), save=True)	# need to check for filenames begining with / or ..?

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/eggs/Django-1.3-py2.7.egg/django/db/models/fields/files.py", line 91, in save
name = self.field.generate_filename(self.instance, name)

File "/praktomatng/installations/praktomat_2011_WS/Praktomat/src/solutions/models.py", line 105, in _get_upload_path
return 'SolutionArchive/Task_' + unicode(solution.task.id) + '/User_' + solution.author.username + '/Solution_' + unicode(solution.id) + '/' + filename

UnicodeDecodeError: 'ascii' codec can't decode byte 0x9a in position 0: ordinal not in range(128)

,
POST:,
COOKIES:{'csrftoken_praktomat_2011_WS': 'daec9a622a6668ebccb8155cfe4d5d99',
'sessionid': '8a6faf6851b4c7cbe379c0bc1566fa18'},
META:{'CONTENT_LENGTH': '3104',
'CONTENT_TYPE': 'multipart/form-data; boundary=---------------------------7db1d73a100886',
'CSRF_COOKIE': 'daec9a622a6668ebccb8155cfe4d5d99',
'DOCUMENT_ROOT': '/praktomat/www',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTPS': '1',
'HTTP_ACCEPT': 'application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*',
'HTTP_ACCEPT_LANGUAGE': 'de-DE',
'HTTP_CONNECTION': 'Keep-Alive',
'HTTP_COOKIE': 'sessionid=8a6faf6851b4c7cbe379c0bc1566fa18; csrftoken_praktomat_2011_WS=daec9a622a6668ebccb8155cfe4d5d99',
'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/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.1; BTRS6241; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; BRI/1; MASM; .NET4.0C)',
'PATH_INFO': u'/tasks/2/solutionupload/',
'PATH_TRANSLATED': '/praktomat/www/tasks/2/solutionupload/',
'QUERY_STRING': '',
'REMOTE_ADDR': '141.3.192.4',
'REMOTE_HOST': 'vpn-cs-vip.tmn.scc.kit.edu',
'REMOTE_PORT': '56048',
'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.0',
'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)}>