FileStorage error if user contains non-ascii characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.app.publication |
Confirmed
|
Undecided
|
Gediminas Paulauskas |
Bug Description
FileStorage's TxnHeader has a 'user' field that is set by zope.app.
2010-09-23 16:23:41,238 http://
Traceback (most recent call last):
File "/home/
publication
File "/home/
super(
File "/home/
txn.commit()
File "/home/
self.
File "/home/
rm.
File "/home/
s = vote(transaction)
File "/home/
self.
File "/home/
return "".join(map(str, [s, self.user, self.descr, self.ext]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 12: ordinal not in range(128)
This is the last problem preventing us from using unicode usernames (LP: #397610). The other issue was fixed in zope.publisher (LP: #131460).
descr field should also handle unicode strings.
Changed in zope.app.publication: | |
status: | New → Confirmed |
assignee: | nobody → Gediminas Paulauskas (menesis) |
Changed in zope.app.publication: | |
assignee: | Gediminas Paulauskas (menesis) → nobody |
assignee: | nobody → Gediminas Paulauskas (menesis) |
The ITransaction interface says
user = zope.interface. Attribute(
"""A user name associated with the transaction.
The format of the user name is defined by the application. The value
is of Python type str. Storages record the user value, as meta-data,
when a transaction commits...
that user is of type str. So the FileStorage implementation is correct in this sense. But I don't understand why it cannot be unicode.
If there is a reason, then re-target this bug to zope.app. publication that should encode the principal id.