[Twisted-web] Re: empty strings in request.args.items()

DJ d.a.abernathy at gmail.com
Fri Jul 11 15:20:48 EDT 2008


Hello All,

I am a twisted novice using the request.args.items() method to write the
data from a form to a web page.
The problem is that the list values are returned with extra empty strings.
I have included a copy of the request string and the dictionary below:

*Here is the request string:*
request <GET
/writeConfigFileChanges?keys=3Dtest&datefmt=3Dmark&format=3D&retryinterva
l=3Djohn&protocol=3D&adaptername=3D&path=3D&isadapter=3D&adaptertype=3D&key=
s=3D&retryinterval=3D
&protocol=3D&adaptername=3D&path=3D&isadapter=3D&adaptertype=3D&formatter=
=3D&class=3D&args=3D&le
vel=3D&keys=3D&level=3D&propagate=3D&qualname=3D&handlers=3D&level=3Dnathan=
&handlers=3D
HTTP/1.1>

*Here are the values in request.args.items():*
{'retryinterval': ['john', ''], 'datefmt': ['mark'], 'args': [''],
'protocol': [
'', ''], 'adaptername': ['', ''], 'keys': ['test', '', ''], 'format': [''],
'isa
dapter': ['', ''], 'propagate': [''], 'handlers': ['', ''], 'path': ['',
''], 'f
ormatter': [''], 'qualname': [''], 'class': [''], 'adaptertype': ['', ''],
'leve
l': ['', '', 'nathan']}

An extra single quote empty string is appended to some of the lists in the
dictionary, those extra empty strings should not be there.
(ex: retryinterval should be -> 'retryinterval': ['john'] ; but instead it
is -> 'retryinterval': ['john', ''] )

Do you know of trick or a work around to correct this ?

-- =

Dafina A. Abernathy (DJ)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20080711/d3=
48ff12/attachment.htm


More information about the Twisted-web mailing list