Fix #417 - bad relative path breaks translations #733
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-22#733
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-417-relative-path"
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?
Problem: Translations don't work when user launches bitmessagemain.py from another directory, like “src/bimessagmain.py”.
This problem was caused by incorrect fallback to an empty string when _MEIPASS is not present. This happens when bitmessage is not running from a onefile executable. In that case, PyInstaller's variable _MEIPASS is not defined, and because empty string is chosen as root path, the path to translations can only work by accident - if user happens to be in that directory.
Solution: if _MEIPASS is not present, fall back to sys.path[0](the location of bitmessagemain.py) so that it works in both modes.
Thank you!