cytoscape / appstore

Cytoscape App Store web application code
16 stars 20 forks source link

Problems with saving pom.xml and javadoc jar #91

Closed coleslaw481 closed 3 years ago

coleslaw481 commented 3 years ago

It looks like the code needs to make different calls if the file is actually an InMemoryUploadedFile instead of a temporary file

Traceback:

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/var/www/appstore/submit_app/views.py" in submit_api
  161.                 pending.pom_xml_file.save(basename(pom_xml_f.name), pom_xml_f)

File "/opt/miniconda3/lib/python3.7/site-packages/django/db/models/fields/files.py" in save
  87.         self.name = self.storage.save(name, content, max_length=self.field.max_length)

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/files/storage.py" in save
  52.         return self._save(name, content)

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/files/storage.py" in _save
  270.                         for chunk in content.chunks():

File "/opt/miniconda3/lib/python3.7/site-packages/django/core/files/uploadedfile.py" in chunks
  91.         self.file.seek(0)

Exception Type: ValueError at /submit_app/submit_api/1594
Exception Value: I/O operation on closed file.
Request information:
USER: XXXXX

GET: No GET data

POST:

FILES:
pom_xml = <InMemoryUploadedFile: pom.xml (text/xml)>
javadocs_jar = <InMemoryUploadedFile: XXX-javadoc.jar (application/x-java-archive)>
coleslaw481 commented 3 years ago

A fix for this has been committed on master branch: d0ee0c4..84549af master -> master