Ticket #7672 (new defect)
Scoped repository with non-ASCII path name errors
| Reported by: | richard.liao.i@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.12 |
| Component: | version control | Version: | 0.12dev |
| Severity: | major | Keywords: | scoped repository unicode svn |
| Cc: |
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
Change History
Note: See
TracTickets for help on using
tickets.


