Fix exception in class_sqlThread on Windows when loading database
from the file with unicode character in path. Closes: #165.
This commit is contained in:
parent
448e9e2f36
commit
b4645c9823
|
@ -29,7 +29,8 @@ class sqlThread(threading.Thread):
|
|||
def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-statements
|
||||
"""Process SQL queries from `.helper_sql.sqlSubmitQueue`"""
|
||||
helper_sql.sql_available = True
|
||||
self.conn = sqlite3.connect(state.appdata + 'messages.dat')
|
||||
self.conn = sqlite3.connect(
|
||||
os.path.join(state.appdata, 'messages.dat'))
|
||||
self.conn.text_factory = str
|
||||
self.cur = self.conn.cursor()
|
||||
|
||||
|
|
10
src/paths.py
10
src/paths.py
|
@ -23,7 +23,8 @@ def lookupExeFolder():
|
|||
# targetdir/Bitmessage.app/Contents/MacOS/Bitmessage
|
||||
os.path.dirname(sys.executable).split(os.path.sep)[0] + os.path.sep
|
||||
if frozen == "macosx_app" else
|
||||
os.path.dirname(sys.executable) + os.path.sep)
|
||||
os.path.dirname(sys.executable).decode(
|
||||
sys.getfilesystemencoding(), 'ignore') + os.path.sep)
|
||||
elif __file__:
|
||||
exeFolder = os.path.dirname(__file__) + os.path.sep
|
||||
else:
|
||||
|
@ -49,11 +50,10 @@ def lookupAppdataFolder():
|
|||
sys.exit(
|
||||
'Could not find home folder, please report this message'
|
||||
' and your OS X version to the BitMessage Github.')
|
||||
elif 'win32' in sys.platform or 'win64' in sys.platform:
|
||||
elif sys.platform.startswith('win'):
|
||||
dataFolder = os.path.join(
|
||||
os.environ['APPDATA'].decode(
|
||||
sys.getfilesystemencoding(), 'ignore'), APPNAME
|
||||
) + os.path.sep
|
||||
os.environ['APPDATA'], APPNAME
|
||||
).decode(sys.getfilesystemencoding(), 'ignore') + os.path.sep
|
||||
else:
|
||||
try:
|
||||
dataFolder = os.path.join(os.environ['XDG_CONFIG_HOME'], APPNAME)
|
||||
|
|
Reference in New Issue
Block a user