Changeset 1485:d27a72b230d2
- Timestamp:
- 11/24/09 07:39:21 (4 months ago)
- Author:
- Alexandre Rossi <alexandre.rossi@…>
- Branch:
- default
- convert_revision:
- e58f53808fda5763aa2a816af2e1ade887f787d2
- Message:
-
[inotify] fix traceback printing when charset decode has failed
Ignore-this: 36122175c181cf35526fc9669cda1bea
darcs-hash:20091124063921-85ee7-2dc44ce20346c1a6d48c4091c02d30d04bf90756.gz
committer: Alexandre Rossi <alexandre.rossi@…>
- Location:
- deejayd
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1484
|
r1485
|
|
| 94 | 94 | self.__need_update = True |
| 95 | 95 | except Exception, ex: |
| 96 | | path = str_encode(os.path.join(event.path, event.name)) |
| | 96 | path = str_encode(os.path.join(event.path, event.name), |
| | 97 | errors='replace') |
| 97 | 98 | log.err(_("Inotify problem for '%s', see traceback") % path) |
| 98 | 99 | log.err("------------------Traceback lines--------------------") |
-
|
r1469
|
r1485
|
|
| 25 | 25 | return "file://%s" % urllib.quote(path) |
| 26 | 26 | |
| 27 | | def str_encode(data, charset = 'utf-8'): |
| | 27 | def str_encode(data, charset = 'utf-8', errors='strict'): |
| 28 | 28 | if type(data) is unicode: return data |
| 29 | | try: rs = data.decode(charset, "strict") |
| | 29 | try: rs = data.decode(charset, errors) |
| 30 | 30 | except UnicodeError: |
| 31 | 31 | log.err(_("%s string has wrong characters, skip it") %\ |