epfl-cede / jupyterhub-fileserver-api

1 stars 0 forks source link

blob has no len() #3

Closed BenGig closed 11 months ago

BenGig commented 2 years ago

Just discovered when I tried to debug another issue:

In fct_zip.py, line 181ff, there is

            try:
                zip.PutZip(self.blob, self.root)
            except Exception as e:
                if len(self.blob) == 0:
                    self.status = "Error: zip blob size is 0"

In my debug code, I tried

        log.write("UzU info", "--- Blob size is {0}".format(len(self.blob)), "None")

and got the error

>       log.write("UzU info", "--- Blob size is {0}".format(len(self.blob)), "None")
E       TypeError: object of type 'FileStorage' has no len()

So should an exception occur, it will not be handled properly because of another exception on if len(self.blob) == 0.

I'm not able to handle this now, because I'm in vacation the next 2 weeks. I put it in an issue as a reminder.

BenGig commented 11 months ago

Fixed in branch zipsize-debug and merged