~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/listing.py

  • Committer: William Grant
  • Date: 2008-07-02 06:38:08 UTC
  • Revision ID: wgrant@ivle-dev-20080702063808-6u8uybf4gvem3u3l
lib/fileservice_lib/listing.py: Decode filenames as UTF-8. This fixes
    almost all of the Unicode filename breakage. Everybody has been
    using UTF-8 filenames since Breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
            ls_list = svnclient.list(path, revision=revision, recurse=False)
221
221
            for ls in ls_list:
222
222
                filename, attrs = PysvnList_tofileinfo(path, ls)
223
 
                listing[filename] = attrs
 
223
                listing[filename.decode('utf-8')] = attrs
224
224
        else:
225
225
            status_list = svnclient.status(path, recurse=False, get_all=True,
226
226
                        update=False)
227
227
            for status in status_list:
228
228
                filename, attrs = PysvnStatus_to_fileinfo(path, status)
229
 
                listing[filename] = attrs
 
229
                listing[filename.decode('utf-8')] = attrs
230
230
    except pysvn.ClientError:
231
231
        # Presumably the directory is not under version control.
232
232
        # Fallback to just an OS file listing.
233
233
        try:
234
234
            for filename in os.listdir(path):
235
 
                listing[filename] = file_to_fileinfo(path, filename)
 
235
                listing[filename.decode('utf-8')] = file_to_fileinfo(path, filename)
236
236
        except OSError:
237
237
            # Non-directories will error - that's OK, we just want the "."
238
238
            pass