[tahoe-dev] eating my own dog food -- Zooko's hlog

Brian Warner warner-tahoe at allmydata.com
Wed Jul 30 11:11:44 PDT 2008

> Any objection to Tahoe stripping out linefeeds and whitespace, per Drew's
> suggestion?

Nope, that sounds fine.. I'd only do it in the HTML input form, though (i.e.
the "wui" as opposed to the "wapi").

The relevant lines of code (in trunk) are:

 allmydata/web/root.py:29 (URIHandler.render_GET)
 allmydata/web/directory.py:278 (DirectoryNodeHandler._POST_uri)

The first is reached from the welcome page (to paste in a cap and get
redirected to /uri/CAP), and the second is reached from a directory page (to
attach a child by name+cap).

Something like perl's s/\s+//g would do the trick.. I don't know how to do
this in python... str.translate?

And of course we'll need tests for each case:
 GET /uri (form field uri="URI:... whitespace ...")
 POST /uri/DIRCAP (form fields name="foo" uri="URI:... whitespace ...")


More information about the tahoe-dev mailing list