Support unicode string in testbrowser
Bug #71960 reported by
Francis J. Lacoste
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BlueBream |
New
|
Undecided
|
Unassigned | ||
Launchpad itself |
Won't Fix
|
Low
|
Unassigned | ||
Zope 3 |
Won't Fix
|
Undecided
|
Unassigned | ||
zope.testbrowser |
Invalid
|
Low
|
Unassigned |
Bug Description
Currently, if we want to upload a form containing non-ASCII characters we have to take care of the encoding ourselves. We should be able to just put an unicode string in and let the ClientForm library takes care of the encoding (taking care of uploading in the same charset than the page).
For example, the following will fail with an unicode error:
>>> browser.
>>> browser.
The workaround is to call .encode('utf-8'):
>>> browser.
>>> browser.
Changed in launchpad: | |
status: | Unconfirmed → Confirmed |
Changed in launchpad: | |
importance: | Undecided → Low |
Changed in zope3: | |
status: | New → Won't Fix |
Changed in zope.testbrowser: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in launchpad: | |
status: | Triaged → Won't Fix |
To post a comment you must log in.
This hack is probably outdated, but is illustrates one possible solution.
zope.testing merge.doctest:1486 self._fakeout, "ascii", "utf-8")
sys.stdout = self._fakeout
Becomes
from codecs import EncodedFile
sys.stdout = EncodedFile(