Modify ↓
#7672 closed defect (fixed)
Scoped repository with non-ASCII path name errors
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11.3 |
| Component: | version control | Version: | 0.12dev |
| Severity: | major | Keywords: | scoped repository unicode svn |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
When I config trac using scoped repository, which path name contains non-ascii characters, will raise UnicodeDecodeError in trac-admin resync and browser:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 8: ordinal not in range(128)
Test in trac 0.10.4, 0.11 and 0.12, all have the same problem.
Here is the patch:
Index: svn_fs.py =================================================================== @@ -111,7 +111,7 @@ """Check whether the given `fullpath` is within the given `scope`""" if scope == '/': return fullpath is not None - fullpath = fullpath and fullpath.lstrip('/') or '' + fullpath = to_unicode(fullpath and fullpath.lstrip('/') or '') scope = scope.strip('/') return (fullpath + '/').startswith(scope + '/') @@ -404,7 +404,7 @@ Repository.__init__(self, name, authz, log) if self.path != path: - self.scope = path[len(self.path):] + self.scope = to_unicode(path[len(self.path):]) if not self.scope[-1] == '/': self.scope += '/' else:
Attachments (0)
Change History (3)
comment:1 by , 17 years ago
| Keywords: | unicode svn added |
|---|---|
| Owner: | set to |
| Priority: | normal → high |
comment:2 by , 17 years ago
| Milestone: | 0.12 → 0.11.3 |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Was incidentally fixed during the r7842 clean-up.
comment:3 by , 17 years ago
Note:
See TracTickets
for help on using tickets.



Well, yes, I see the bug:
self.scopeis sometimes supposed to be utf-8str, sometimesunicode. We need to clarify what is supposed to be kept as utf-8 and what not, in a more explicit way.([OT] and yes, to add some weight to #7018, I just found myself entering "unicode svn" in the Cc: field :-) )