deleting nameless file confounds webish.py #94

Closed
opened 2007-08-09 05:54:23 +00:00 by arch_o_median · 5 comments
arch_o_median commented 2007-08-09 05:54:23 +00:00
Owner

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
> 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 ```
tahoe-lafs added the
code
minor
defect
0.4.0
labels 2007-08-09 05:54:23 +00:00
tahoe-lafs added this to the eventually milestone 2007-08-09 05:54:23 +00:00
arch_o_median commented 2007-08-09 05:57:04 +00:00
Author
Owner

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](wiki/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

Replying to [arch_o_median](/tahoe-lafs/trac-2024-07-25/issues/5156): > 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](wiki/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

fixing formatting

fixing formatting
zooko added the
fixed
label 2007-08-09 05:59:29 +00:00
zooko closed this issue 2007-08-09 05:59:29 +00:00
zooko changed title from uploading empty-string filenames confounds webish.py to deleting nameless file confounds webish.py 2007-08-09 05:59:29 +00:00
tahoe-lafs removed the
fixed
label 2007-08-09 06:01:27 +00:00
arch_o_median reopened this issue 2007-08-09 06:01:27 +00:00
arch_o_median commented 2007-08-09 06:04:37 +00:00
Author
Owner

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

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

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

hm, good point. We should catch and ignore (possibly with some sort of admonition to "don't do that") that case.
warner added
code-frontend-web
and removed
code
labels 2007-08-14 18:58:25 +00:00

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.

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.
warner added the
fixed
label 2007-08-15 23:15:33 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#94
No description provided.