[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python Site Package Syntax Runtime Error

From: Antwane Mason
Subject: Re: Python Site Package Syntax Runtime Error
Date: Mon, 20 Sep 2021 16:28:12 -0400

On Mon, Sep 20, 2021 at 8:32 AM Hartmut Goebel <> wrote:
Looking at the code of the package - which actually is quite simple - I discover


This might indeed trigger some issue in phase wrap. Please open a bug-report for this, explicitly pointing to release v1.1.11 of that package.

As a solution for you I propose replacing the aforementioned line in by this line:


I also suggest reporting this upstream, since I assume having in bin is not desired. (Actually this is not a working script at all.)

Thank you for the suggestion!  Taking your advice, I ended up with the following snippet which ends up being simpler than overwriting the wrap phase.
The main parts added are the modules field and snippet field; I simply added the whole source field so it is clear where those two fields go within the package definition.

--8<---------------cut here---------------start------------->8---
        (method url-fetch)
        (uri (pypi-uri "onlykey-agent" version))
        (modules '((guix build utils)))
         '(begin (substitute* ""
--8<---------------cut here---------------end--------------->8---

After reinstalling onlykey-agent with the above change, I got the following runtime error when running onlykey-gpg init "Firstname Lastname <>".

--8<---------------cut here---------------start------------->8---
Traceback (most recent call last):
  File "/gnu/store/rg6jn2bhrgmfhbkiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/bin/.onlykey-gpg-real", line 11, in <module>
    load_entry_point('onlykey-agent==1.1.12', 'console_scripts', 'onlykey-gpg')()
  File "/gnu/store/rg6jn2bhrgmfhbkiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/lib/python3.8/site-packages/", line 6, in <lambda>
    gpg_tool = lambda: libagent.gpg.main(DeviceType)
  File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/gpg/", line 381, in main
    return args.func(device_type=device_type, args=args)
  File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/gpg/", line 154, in run_init
    agent_path = util.which('{}-gpg-agent'.format(device_name))
  File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/", line 212, in wrapper
    result = func(*args, **kwargs)
  File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/", line 248, in which
    raise OSError('Cannot find {!r} in $PATH'.format(cmd))
OSError: Cannot find '.onlykey-gpg-gpg-agent' in $PATH
--8<---------------cut here---------------end--------------->8---

From what I can tell, the issue is that the inherited __str__ for Onlykey class uses __name__ which resolves to '.onlykey-gpg'. This results in trying to get the full path for
'.onlykey-gpg-gpg-agent' which doesn't exist. I think it should be instead trying to get the path of 'onlykey-gpg-agent'. I plan on trying to patch lib-agent to define a __str__ method that returns 'onlykey' for Onlykey class.
I'm hoping that will fix the issue.

At the end of this, I plan to submit a bug report as you suggested.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]