Skip to content

Commit

Permalink
Fix Tails detection in Python 3 + Tails 3.x
Browse files Browse the repository at this point in the history
The final comparison failed to account for the fact that the
subprocess module returns a byte literal.

Incorrect Tails detection caused torify not to be used, which
caused a network error during the creation of the virtualenv
on Tails 3.x.

Decoding the string first reduces the likelihood of such
coding errors.

Fixes #4925
  • Loading branch information
eloquence committed Oct 17, 2019
1 parent 804ff0a commit a267c79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def run_command(command):
def is_tails():
try:
id = subprocess.check_output('lsb_release --id --short',
shell=True).strip()
shell=True).decode('utf-8').strip()
except subprocess.CalledProcessError:
id = None

# dirty hack to unreliably detect Tails 4.0~beta2
if id == b'Debian':
if id == 'Debian':
if os.uname()[1] == 'amnesia':
id = 'Tails'

Expand Down

0 comments on commit a267c79

Please sign in to comment.