From c0f37e1a421718a6e4a725602bdcce46d387ae30 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Mon, 15 Feb 2010 11:12:09 +0000 Subject: [PATCH] Support for non ASCII usernames in Windows. svn: r14383 --- src/cli/clidbman.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/clidbman.py b/src/cli/clidbman.py index bb23dcf23..a7060b101 100644 --- a/src/cli/clidbman.py +++ b/src/cli/clidbman.py @@ -33,6 +33,7 @@ creating, and deleting of databases. # #------------------------------------------------------------------------- import os +import sys import time from gen.ggettext import gettext as _ #------------------------------------------------------------------------- @@ -384,6 +385,10 @@ def find_locker_name(dirpath): fname = os.path.join(dirpath, "lock") ifile = open(fname) username = ifile.read().strip() + # Convert username to unicode according to system encoding + # Otherwise problems with non ASCII characters in + # username in Windows + username = unicode(username, sys.getfilesystemencoding()) last = _("Locked by %s") % username ifile.close() except (OSError, IOError):