unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: 34377@debbugs.gnu.org
Subject: bug#34377: (ledger|trezor|keepkey)-agent execute shell code with python interpreter
Date: Thu, 07 Feb 2019 17:34:33 -0800	[thread overview]
Message-ID: <87mun76p1y.fsf@ponder> (raw)

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

When running trezor-agent (or any of the others), I get a bizarre python
traceback with a bunch of code that looks to be shell code.

$ trezor-agent
Traceback (most recent call last):
  File "/gnu/store/77i5pm165ljn8fx030z41yqaja77lb99-trezor-agent-0.10.0/bin/.trezor-agent-real", line 11, in <module>
    load_entry_point('trezor-agent==0.10.0', 'console_scripts', 'trezor-agent')()
  File "/gnu/store/9z98cvjm7p7z21xdid1ryydxy5vyz6wr-python-3.7.0/lib/python3.7/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point
...
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/gnu/store/77i5pm165ljn8fx030z41yqaja77lb99-trezor-agent-0.10.0/bin/trezor_agent.py", line 2
    export PYTHONPATH="/gnu/store/ ... site-packages${PYTHONPATH:+:}$PYTHONPATH"
                    ^
SyntaxError: invalid syntax

It looks to me that .trezor-agent-real is trying to import
trezor_agent.py as a python module, and obviously failing, because it
is also a shell wrapper around .trezor_agent.py-real

My guess is the correct way to fix this is to not install the shell
wrapper around trezor_agent.py and/or put trezor_agent.py into a
proper module in PYTHONPATH, rather than in /bin.

I'm not sure how to do that in the packaging, but I've manually hacked
around this by copying all of the .*-real files from /bin into another
directory, renaming them to their original names, adding the directory
to PATH, and setting PYTHONPATH manually to what the shell wrappers were
doing, and then I'm able to at least use the ssh-agent and gpg-agent
functionality...


Currently, none of these packages build in master because python-trezor
doesn't build anymore, but I've submitted a patch to update and fix
python-trezor(#34326), and have local patches dependent on that to
update python-trezor-agent, trezor-agent, ledger-agent and keepkey-agent
that at least get it to build.


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

             reply	other threads:[~2019-02-08  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  1:34 Vagrant Cascadian [this message]
     [not found] ` <handler.34377.B.154958970210386.ack@debbugs.gnu.org>
2019-02-08  3:28   ` bug#34377: (ledger|trezor|keepkey)-agent execute shell code with python interpreter Vagrant Cascadian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mun76p1y.fsf@ponder \
    --to=vagrant@debian.org \
    --cc=34377@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).