Changes between Initial Version and Version 1 of Ticket #8538
- Timestamp:
- Aug 9, 2009, 11:54:50 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #8538
- Property Keywords unicode added
- Property Milestone 0.11.6 → not applicable
-
Ticket #8538 – Description
initial v1 6 6 7 7 When you want to open dir in browse source with a file or child file with an accented charcater (ó) the error shows: 8 8 {{{ 9 9 Most recent call last: 10 10 File "/usr/local/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request … … 17 17 entries = [entry(n) for n in node.get_entries()] 18 18 File "/var/trac/scrum.pxgo.es/norprevencion_openerp/plugins/TracMercurial-0.11.0.7-py2.5.egg/tracext/hg/backend.py", line 697, in get_entriesFile "/var/trac/scrum.pxgo.es/norprevencion_openerp/plugins/TracMercurial-0.11.0.7-py2.5.egg/tracext/hg/backend.py", line 605, in findnode 19 }}} 19 20 20 21 Patch: 21 22 22 23 In TracMercurial-0.11.0.7-py2.5.egg/tracext/hg/backend.py method findnode: 23 24 {{{ 24 25 for f in self.repos.repo.changectx(rev).files(): 25 26 f = unicode(f, 'utf-8', 'replace') 27 }}} 26 28 27 29 #convert to unicode with replace and utf-8 encode and the name of file process correctly. 28 30 29 31 Then the dir works if the file is another dir else the error shows in other part of code: 30 32 {{{ 31 33 Most recent call last: 32 34 File "/usr/local/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request … … 40 42 File "/var/trac/scrum.pxgo.es/norprevencion_openerp/plugins/TracMercurial-0.11.0.7-py2.5.egg/tracext/hg/backend.py", line 691, in get_entriesFile "/usr/local/lib/python2.5/posixpath.py", line 65, in join 41 43 path += '/' + b 42 44 }}} 43 45 Patch: 44 46 45 47 In TracMercurial-0.11.0.7-py2.5.egg/tracext/hg/backend.py method get_entries the same: 46 48 {{{ 47 49 for entry in self.entries: 48 50 entry = unicode(entry, 'utf-8', 'replace') 49 51 }}} 50 52 #convert the file's name to unicode with replace and encode in utf-8 51 53 52 54 Then the dir with file works but when you want to open the file and error shows: 53 55 {{{ 54 56 Most recent call last: 55 57 File "/usr/local/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request … … 63 65 File "/usr/local/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/href.py", line 148, in __call__ 64 66 if arg != None]) 67 }}} 65 68 66 69 This bug raise on Trac, i don't know if in new versions it solves, occurs beacause teh name of file have a accented character and in url not escapes the accented character.