Fix the issues with non-ASCII characters in path on Windows #1613
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-04#1613
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "g1itch/windows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello!
This is the fix for the bug on Windows which was recently reported back in chan. When the
messages.dat
file path contains unicode characters the exceptionsqlite3.OperationalError: unable to open database file
is raised and PyBitmessage stops loading.I'm not sure about necessity of the change in
class_sqlThread
(os.path.join()
instead of strings concatenation). The main problem is in encoding of thestate.appdata
string. I used the solution from https://stackoverflow.com/questions/35833037.Related issues are: #165, #978
Thank you, I think it is a step in the right direction. My testing shows that it still doesn't work. I found two issues.
an additional fix is needed if the directory with the executable / source contains unicode (as opposed to merely %APPDATA% being localised):
there are at least some cases where it doesn't convert correctly:
The tests are done on a 64bit Win10 with current updates.
OK, thanks for hint. I've being able to reproduce it only in portable mode with many debug messages added. Can you please tell me how to get such detailed log in console?
In the spec file set debug=True and console=True
It looks like in my case there is an additional problem, I use a US locale in the OS but created a username with non-US characters. Python doesn't like it and I'm not sure how to fix that other than changing the user locale to something compatible, and relogin. After changing the locale it works even without this PR. Unless someone can report that this actually helped him I'm inclined to reject this PR.
Hmm, I really cannot reproduce the issue with non-ASCII characters in username. What I see is the exception raised when you start PyBitmessage in portable mode from the directory containing non-ASCII characters:
Can you tell me how to trigger it?
Put executable into the directory with non-ASCII character in it's name. Run it. Go into Settings and set "User Interface -> Run in Portable mode". Restart PyBitmessage.
Ok.