#94 closed defect (fixed)

deleting nameless file confounds webish.py

Reported by: arch_o_median Owned by: somebody
Priority: minor Milestone: eventually
Component: code-frontend-web Version: 0.4.0
Keywords: Cc:
Launchpad Bug:

Description (last modified by zooko)

I tried to upload a (non) file to the Test Grid. I clicked upload file on the web interface to my client node when the upload field was empty. This resulted in the following Stack Trace:

/usr/lib/python2.5/site-packages/allmydata/webish.py, line 515 in renderHTTP
513

        elif t == "delete":

514

            if not name:

515

                raise RuntimeError("delete requires a name")

516

            d = self._node.delete(name)

Locals
name	''
self	<allmydata.webish.POSTHandler object at 0x8a8988c>
t	'dele

<type 'exceptions.RuntimeError'>: delete requires a name

Change History (7)

comment:1 in reply to: ↑ description Changed at 2007-08-09T05:57:04Z by arch_o_median

Replying to arch_o_median:

I tried to upload a (non) file to the Test Grid. I clicked upload file on the web interface to my client node when the upload field was empty. When I noticed I had uploaded a nameless nothing, I tried to delete it by pressing the "Del" button. This resulted in the following Stack Trace:

/usr/lib/python2.5/site-packages/allmydata/webish.py, line 515 in renderHTTP 513

elif t == "delete":

514

if not name:

515

raise RuntimeError?("delete requires a name")

516

d = self._node.delete(name)

Locals name self <allmydata.webish.POSTHandler object at 0x8a8988c> t 'delete'

<type 'exceptions.RuntimeError?'>: delete requires a name

comment:2 Changed at 2007-08-09T05:59:29Z by zooko

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from uploading empty-string filenames confounds webish.py to deleting nameless file confounds webish.py

fixing formatting

comment:3 Changed at 2007-08-09T06:01:27Z by arch_o_median

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 in reply to: ↑ description Changed at 2007-08-09T06:04:37Z by arch_o_median

CORRECTION: I caused the error by attempting to _delete_ empty-string-named file, _not_ by uploading it as previously (mis)stated.

comment:5 Changed at 2007-08-09T20:12:54Z by warner

hm, good point. We should catch and ignore (possibly with some sort of admonition to "don't do that") that case.

comment:6 Changed at 2007-08-14T18:58:25Z by warner

  • Component changed from code to code-frontend-web

comment:7 Changed at 2007-08-15T23:15:33Z by warner

  • Resolution set to fixed
  • Status changed from reopened to closed

I've fixed webish.py to allow you to delete empty-named files. I also changed it to prohibit you from creating them in the first place.. if you really want to do confusing stuff like that, you'll have to use the PUT api to do it :). But this change will let you clean up the results without getting exceptions.

Note: See TracTickets for help on using tickets.