#8425 closed defect (duplicate)
Unable to use $USER in default query in config for user names with non ascii letters
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.11.1 |
Severity: | normal | Keywords: | unicode verify |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If user name contains some UTF characters (e.g. UTFęąó) and default query uses $USER, error is displayed in default query for this user:
Oops... Trac detected an internal error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-26: ordinal not in range(128)
Might be related to #6318, but after reading that ticket I am not sure.
Attachments (0)
Change History (5)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
$ sqlite3 —version 3.5.9 $ file trac.db trac.db: SQLite 3.x database
It is quite intersting. It does not depend on DB. There is no ticket for this user in db, and if I enter query manually, then it works, e.g.
Works correctly, and is direct equivalent of default query set in trac.ini:
default_query = status!=closed&owner=$USER
comment:4 by , 15 years ago
Keywords: | unicode verify added |
---|---|
Milestone: | → 0.12.1 |
comment:5 by , 14 years ago
Milestone: | next-minor-0.12.x |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
The problem described here must be derived from #6318 (i.e. the fact that non-ascii user names are not supported in the first place).
Regarding comment:3, the login might work by chance, if the authentication information happen to be stored with the same encoding as the encoded login name, but as soon as we try to make use of this name in the rest of Trac, we have encoding issues.
Well, #6318 shows that non-ascii characters for user names is not supported, so using them nevertheless exposes to lots of trouble, like risking to get non-UTF8 data in your database.
Which database backend are you using, btw?