Commit Graph

6 Commits

Author SHA1 Message Date
Apprentice Harper
582479c1f4
Merge pull request #845 from aplaice/fix_default_winepath
Fix automatic import of decryption keys on Linux with wine
2020-01-30 12:02:15 +00:00
Apprentice Harper
f5dd758b1b
Merge branch 'master' into modernize-Python-2-codes 2020-01-30 11:58:50 +00:00
Christian Clauss
616548a9a8
Undefined name: import traceback for line 70 2020-01-20 13:52:54 +01:00
cclauss
5bb6b58bc1 Use print() function in both Python 2 and Python 3
Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
2019-06-24 18:49:38 +02:00
Adam Plaice
4bd89fa4aa Fix automatic import of decryption keys on Linux with wine
By default, the wineprefix passed to WineGetKeys is "". Unfortunately,

    os.path.abspath(os.path.expanduser(os.path.expandvars("")))

returns the path to the working directory, which depends on the
directory from which calibre was invoked.  Hence under current
behaviour the wineprefix becomes that path, no longer being the empty
string.  This means that the `cmdline` that's run is always
`WINEPREFIX=/some/path/ wine python.exe [...]`, rather than `wine
python.exe [...]` even under default conditions, when the wineprefix
hasn't been changed.  Unless the user is improbably lucky and invokes
calibre from ~/.wine/ (the default wineprefix), this causes automatic
retrieval of the keys to always fail.

The bug was introduced in f2190a6755.

Checking for "" allows for correct behaviour in the default case,
while keeping the nice behaviour of expanding `~`.
2019-06-12 21:13:25 +02:00
Apprentice Harper
3f21bd9f5a Move to new positions 2018-12-02 11:37:07 +00:00