Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task.py #1312

Merged
merged 1 commit into from Mar 24, 2023
Merged

Update task.py #1312

merged 1 commit into from Mar 24, 2023

Conversation

ezeakeal
Copy link
Contributor

copyfileobj is not defined. I presume it should be shutil.copyfileobj, so it is corrected here.

I have a few hooks in a pre-commit config that help catch these kind of things but maybe this is a result of a merge?

Anyway, I rebuilt WebODM and confirmed this fixed the upload issue on my side.

Previously this broke uploads (stacktrace below).

webapp      | ERROR Internal Server Error: /api/projects/8/tasks/5733e8c1-eecd-4285-8878-cd21a212aad7/upload/
webapp      | Traceback (most recent call last):
webapp      |   File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/exception.py", line 34, in inner
webapp      |     response = get_response(request)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/base.py", line 115, in _get_response
webapp      |     response = self.process_exception_by_middleware(e, request)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/base.py", line 113, in _get_response
webapp      |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
webapp      |     return view_func(*args, **kwargs)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/rest_framework/viewsets.py", line 125, in view
webapp      |     return self.dispatch(request, *args, **kwargs)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/rest_framework/views.py", line 509, in dispatch
webapp      |     response = self.handle_exception(exc)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/rest_framework/views.py", line 469, in handle_exception
webapp      |     self.raise_uncaught_exception(exc)
webapp      |   File "/usr/local/lib/python3.9/dist-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
webapp      |     raise exc
webapp      |   File "/usr/local/lib/python3.9/dist-packages/rest_framework/views.py", line 506, in dispatch
webapp      |     response = handler(request, *args, **kwargs)
webapp      |   File "/webodm/app/api/tasks.py", line 209, in upload
webapp      |     task.handle_images_upload(files)
webapp      |   File "/webodm/app/models/task.py", line 1138, in handle_images_upload
webapp      |     copyfileobj(f, fd)
webapp      | NameError: name 'copyfileobj' is not defined

copyfileobj does not exist, I presume it should be shutil.copyfileobj 
Rebuilding WebODM on a machine in use now to test if this fixes it. 
Currently this breaks uploads
@ezeakeal
Copy link
Contributor Author

Also, just wanted to say that I love the project and the incredible work put into it. Glad to potentially contribute something finally!

@pierotofy
Copy link
Member

Nice catch @ezeakeal , thanks!!

@pierotofy pierotofy merged commit cc573c9 into OpenDroneMap:master Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants