Shalabh Chaturvedi wrote: > When I use Form(enctype="multipart/form-data"), the newlines of a > textarea are duplicated each time the form is submitted. Since I have a > preview button which shows the same form again, each time the button is > clicked, the textarea appears with double the spaces between the lines. >A (trivial) patch to fix this is below. The '\n'.join() is unnecessary as the readpart() function already returns lines that contain '\r\n'. Interestingly, I saw the problem using Firefox, but not using Konqueror. Firefox uses '\r\n' to separate lines of a textares (as recommended by the HTML Spec [1]) but Konqueror uses just '\n'. So multiple lines in Konqueror get processed as one line by the code and the extra '\n' is not inserted. Both Firefox and Konqueror work fine after the fix. Cheers, Shalabh ### patch for http_request.py ### --- down/Quixote-2.0a3/http_request.py Thu Dec 9 16:13:23 2004 +++ /usr/local/lib/python2.3/site-packages/quixote/http_request.py Sat Dec 25 22:25:20 2004 @@ -229,5 +229,5 @@ _add_field_value(self.form, name, upload) else: - _add_field_value(self.form, name, '\n'.join(lines)) + _add_field_value(self.form, name, ''.join(lines)) def get_header(self, name, default=None): ### end of patch ### [1] http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2