Skip to content

Commit

Permalink
Fixes for unicode strings converted to ASCII.
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinlawson committed Aug 22, 2011
1 parent 2677e9e commit 3bde1a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion ChangeLog
Expand Up @@ -21,7 +21,11 @@
**** Boston, MA 02111-1307 USA ****
*******************************************************************************

2010-09-16 Kelvin Lawson <kelvinl@users.sf.net> 0.7.4
2011-08-22 Kelvin Lawson <kelvinl@users.sf.net>
* Bug fixes:
pykdb.py: Fixes for unicode strings converted to ASCII.

2011-06-19 Kelvin Lawson <kelvinl@users.sf.net> 0.7.4
* Bug fixes:
pykaraoke.py: Allow search for unicode song names.
pykaraoke.py: Fix FileDetails dialog for non-ascii characters.
Expand Down
11 changes: 6 additions & 5 deletions pykdb.py
Expand Up @@ -1387,9 +1387,10 @@ def folderScan (self, FolderToScan, progress, yielder):
print "Couldn't scan %s" % (repr(FolderToScan))
return False

# Sort the list, using plain strings for the sort key to
# prevent issues with non-unicode files in the list
filedir_list.sort(key=str)
# Sort the list, using printable strings for the sort key to
# prevent issues with unicode characters in non-unicode strings
# in the list
filedir_list.sort(key=repr)

# Loop through the list
for i in range(len(filedir_list)):
Expand Down Expand Up @@ -1442,7 +1443,7 @@ def fileScan(self, full_path, progress, yielder):
# Every so often, update the progress bar.
basename = os.path.split(full_path)[1]
self.BusyDlg.SetProgress(
"Scanning %s" % basename.encode('ascii', 'replace'),
"Scanning %s" % basename,
self.__computeProgressValue(progress))
yielder.Yield()
self.lastBusyUpdate = now
Expand Down Expand Up @@ -1484,7 +1485,7 @@ def fileScan(self, full_path, progress, yielder):
nextProgress = progress + [(i, len(namelist))]
basename = os.path.split(full_path)[1]
self.BusyDlg.SetProgress(
"Scanning %s" % basename.encode('ascii', 'replace'),
"Scanning %s" % basename,
self.__computeProgressValue(nextProgress))
yielder.Yield()
self.lastBusyUpdate = now
Expand Down

0 comments on commit 3bde1a0

Please sign in to comment.