Activity log for bug #130857

Date Who What changed Old value New value Message
2007-08-07 13:48:24 Eleanor Berger bug added bug
2007-08-07 13:49:10 Eleanor Berger description In a test, I assign a unicode string with some non-ascii characters to the value of a field, and submit the form. I then get the following error (fragment): File "/home/tom/canonical/lp-branches/bug-129948/lib/zope/testbrowser/browser.py", line 568, in click self.browser._clickSubmit(self.mech_form, self.mech_control, (1,1)) File "/home/user/project/lib/zope/testbrowser/browser.py", line 357, in _clickSubmit self.mech_browser.open(form.click( File "/usr/lib/python2.4/site-packages/ClientForm.py", line 2935, in click self._request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3141, in _click return control._click(self, coord, return_type, request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 2299, in _click r = form._switch_click(return_type, request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3209, in _switch_click req_data = self._request_data() File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3192, in _request_data self.controls[control_index]._write_mime_data(mw, k, v) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 1136, in _write_mime_data f.write(value) UnicodeEncodeError: 'ascii' codec can't encode character u'\xab' in position 0: ordinal not in range(128) To behave more like a real browser, the test browser should automatically encode its content, trying to get the desired encoding from the form, or if that fails, from the page or from a sensible default (utf-8?). In a test, I assign a unicode string with some non-ascii characters to the value of a field, and submit the form. I then get the following error (fragment): File "/home/user/project/lib/zope/testbrowser/browser.py", line 568, in click self.browser._clickSubmit(self.mech_form, self.mech_control, (1,1)) File "/home/user/project/lib/zope/testbrowser/browser.py", line 357, in _clickSubmit self.mech_browser.open(form.click( File "/usr/lib/python2.4/site-packages/ClientForm.py", line 2935, in click self._request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3141, in _click return control._click(self, coord, return_type, request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 2299, in _click r = form._switch_click(return_type, request_class) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3209, in _switch_click req_data = self._request_data() File "/usr/lib/python2.4/site-packages/ClientForm.py", line 3192, in _request_data self.controls[control_index]._write_mime_data(mw, k, v) File "/usr/lib/python2.4/site-packages/ClientForm.py", line 1136, in _write_mime_data f.write(value) UnicodeEncodeError: 'ascii' codec can't encode character u'\xab' in position 0: ordinal not in range(128) To behave more like a real browser, the test browser should automatically encode its content, trying to get the desired encoding from the form, or if that fails, from the page or from a sensible default (utf-8?).
2010-04-15 05:01:00 Tres Seaver bug task added zope.testing
2010-04-15 05:01:46 Tres Seaver zope3: status New Won't Fix
2010-04-16 15:01:45 Tres Seaver affects zope.testing zope.testbrowser
2010-05-10 20:31:49 Tres Seaver marked as duplicate 71960