Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main change here is that we fix the broken portable.exe behavior caused by recent versions of PyInstaller now setting the
__file__
attribute to the temp folder where the bundle is temporarily extracted. We don't want the data dir in a temp folder, we want it next to the exe, so useos.getcwd
instead.As a bonus, this probably fixes the
--portable
CLI option which I suspect was broken in Electron Cash when an attempt was made to support py2app. This will allow to run the AppImage or source dist with that option, from a hard drive or USB thumbdrive.This also enables deprecation warnings for developers (anyone running this from a git clone)
Commits backported:
revert py2app support change for portable detection
The way
config["portable"]
is set overwrites the --portable command line flag.Electron-Cash@c99d4e2
run_electrum: small clean-up, and hide DeprecationWarnings if not git
is_bundle
tois_pyinstaller
(no semantic changes, just to clearer name)is_appimage
is_local
is_git_clone
, and restrict DeprecationWarnings to that casespesmilo@5f1a13e
"--portable": make behaviour independent of pyinstaller version
pyinstaller 4.3 changed the value of
__file__
.This change makes our behaviour independent of that pyinstaller change (we always behave like old versions of pyinstaller).
spesmilo@5b500f0
"--portable": more consistent behaviour
The old and new behaviour is as follows:
.exe
, other.exe
s with--portable
, and.dmg
with--portable
- uses$PWD
- note that when you double-click the portable.exe
on Windows,$PWD
is set to the parent folder, i.e. the datadir gets put next to the.exe
--portable
- was broken (see Appimage Linux Electrum doesn't work with portable wallet - "read only filesystem" spesmilo/electrum#5551) - (CHANGED NOW to) uses$PWD
run_electrum
tar.gz
and running locally from it - next torun_electrum
pip install *.tar.gz
, and calling "electrum --portable" from terminal - used python's user script directory -~/.local/bin/electrum_data
-$VIRTUAL_ENV/bin/electrum_data
- (CHANGED NOW to) uses$PWD
That is, we now almost always put the datadir in
$PWD
, except for the local source case, where we put it next torun_electrum
.The "appimage" case (2) is now fixed.
The only breaking change is re case 5 which previously behaved completely unintuitively and most likely not in a useful way.
spesmilo@6a34d93