Fix the issues with non-ASCII characters in path on Windows #1613

Open
g1itch wants to merge 4 commits from g1itch/windows into v0.6
2 changed files with 7 additions and 6 deletions
Showing only changes of commit b4645c9823 - Show all commits

View File

@ -29,7 +29,8 @@ class sqlThread(threading.Thread):
def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-statements def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-statements
"""Process SQL queries from `.helper_sql.sqlSubmitQueue`""" """Process SQL queries from `.helper_sql.sqlSubmitQueue`"""
helper_sql.sql_available = True 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.conn.text_factory = str
self.cur = self.conn.cursor() self.cur = self.conn.cursor()

View File

@ -23,7 +23,8 @@ def lookupExeFolder():
# targetdir/Bitmessage.app/Contents/MacOS/Bitmessage # targetdir/Bitmessage.app/Contents/MacOS/Bitmessage
os.path.dirname(sys.executable).split(os.path.sep)[0] + os.path.sep os.path.dirname(sys.executable).split(os.path.sep)[0] + os.path.sep
if frozen == "macosx_app" else 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__: elif __file__:
exeFolder = os.path.dirname(__file__) + os.path.sep exeFolder = os.path.dirname(__file__) + os.path.sep
else: else:
@ -49,11 +50,10 @@ def lookupAppdataFolder():
sys.exit( sys.exit(
'Could not find home folder, please report this message' 'Could not find home folder, please report this message'
' and your OS X version to the BitMessage Github.') ' 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( dataFolder = os.path.join(
os.environ['APPDATA'].decode( os.environ['APPDATA'], APPNAME
sys.getfilesystemencoding(), 'ignore'), APPNAME ).decode(sys.getfilesystemencoding(), 'ignore') + os.path.sep
) + os.path.sep
else: else:
try: try:
dataFolder = os.path.join(os.environ['XDG_CONFIG_HOME'], APPNAME) dataFolder = os.path.join(os.environ['XDG_CONFIG_HOME'], APPNAME)