Support for non ASCII usernames in Windows.
svn: r14383
This commit is contained in:
parent
f97e6622e4
commit
c0f37e1a42
@ -33,6 +33,7 @@ creating, and deleting of databases.
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -384,6 +385,10 @@ def find_locker_name(dirpath):
|
|||||||
fname = os.path.join(dirpath, "lock")
|
fname = os.path.join(dirpath, "lock")
|
||||||
ifile = open(fname)
|
ifile = open(fname)
|
||||||
username = ifile.read().strip()
|
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
|
last = _("Locked by %s") % username
|
||||||
ifile.close()
|
ifile.close()
|
||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
|
Loading…
Reference in New Issue
Block a user