DistrictDataLabs / cultivar

Multidimensional data explorer and visualization tool.
http://trinket.districtdatalabs.com
Apache License 2.0
52 stars 18 forks source link

Upload Error: line contains NULL byte #2

Open bbengfort opened 8 years ago

bbengfort commented 8 years ago

Internal Server Error: /upload/ Traceback (most recent call last): File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, _callback_args, _callback_kwargs) File "/app/.heroku/python/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, _args, _kwargs) File "/app/.heroku/python/lib/python2.7/site-packages/braces/views/_access.py", line 98, in dispatch request, _args, _kwargs) File "/app/.heroku/python/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch return handler(request, _args, _kwargs) File "/app/.heroku/python/lib/python2.7/site-packages/django/views/generic/edit.py", line 215, in post return self.form_valid(form) File "/app/coffer/views.py", line 50, in form_valid form.save() File "/app/coffer/forms.py", line 51, in save dataset=self.cleaned_data['dataset'], uploader=self.request.user File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method return getattr(self.get_queryset(), name)(_args, *_kwargs) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 348, in create obj.save(force_insert=True, using=self.db) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save force_update=force_update, update_fields=update_fields) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py", line 758, in save_base update_fields=update_fields) File "/app/.heroku/python/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 201, in send response = receiver(signal=self, sender=sender, **named) File "/app/coffer/signals.py", line 51, in dataset_file_compute header = reader.next() File "/app/.heroku/python/lib/python2.7/site-packages/unicodecsv/py2.py", line 117, in next row = self.reader.next() Error: line contains NULL byte

bbengfort commented 8 years ago

@rebeccabilbro do you know what you were uploading that caused this?

rebeccabilbro commented 8 years ago

@bbengfort seeing what would happen if I tried to upload a sample (but empty) protected file

bbengfort commented 8 years ago

Ah, well it looks like it doesn't like the emptiness - didn't say anything about the protection.

rebeccabilbro commented 8 years ago

Just added another empty file, this one without protections. Upload was successful.

bbengfort commented 8 years ago

Interesting, not 100% sure if that's a bug or a feature - though we shouldn't get more than one empty file, since an empty file should always have the same hash. I guess we could put a check in to prevent it from happening .