Menu

#339 Python bindings broken because config.py not installed

Future
closed
nobody
None
na
2023-03-23
2018-10-06
No

The Python bindings are broken because config.py does not get installed. This results in this error when attempting to import lirc:

ModuleNotFoundError: No module named 'lirc.config'

I have run into this problem on NixOS and Arch Linux. There is an existing Arch Linux bug report for this issue: https://bugs.archlinux.org/task/58232

It seems like it was not an accident that config.py does not get installed, but I'm not sure what the reason was.

The attached patch is a modified version of the patch in the Arch bug report. It also contains another minor fix for NixOS. lirc tries to modify files which it may not have permission to modify, so it catches a PermissionError. NixOS installs the package to a read only bind mount, which results in an OSError instead of a PermissionError. This patch add OSError to the except statement.

1 Attachments

Discussion

  • Cedric Schieli

    Cedric Schieli - 2019-05-08

    Same issue on Gentoo.

    According to the commit (0ab24de56) it was removed to fix #294, but the discussion there doesn't explain the reason. And even worse, none of the patches from the discussion contains the removal.

     
  • Alex Barcelo

    Alex Barcelo - 2020-05-22

    I also stumbled with this bug --specifically in a Raspberry Pi with Debian [Raspbian] Buster.

    Will this be merged or assigned to any milestone? I see that is has been a few years since last release (0.10.1) but there is quite a lot of job done on other branches / issues resolved, so I was hoping for maybe a new release with all that? Also building from sources in a Raspberry Pi device is very slow, so... you know, I try to avoid it or only do it once, ofc.

     
  • David H. Bronke

    David H. Bronke - 2023-02-19

    I'm still running into this as well. There's a patch that was written in this ArchLinux ticket which should fix the issue:

    --- src/lirc-0.10.0/Makefile.am.orig 2017-08-12 02:37:11.000000000 -0400
    +++ src/lirc-0.10.0/Makefile.am 2018-02-08 14:44:29.241721957 -0500
    @@ -78,9 +78,10 @@
    py_pkg_lircdir = $(pkgdatadir)/python-pkg/lirc
    py_PYTHON = python-pkg/lirc/__init__.py \
    python-pkg/lirc/database.py \
    - python-pkg/lirc/paths.py
    + python-pkg/lirc/paths.py \
    + python-pkg/lirc/config.py
    
    -nodist_py_pkg_PYTHON = python-pkg/lirc/config.py
    +#nodist_py_pkg_PYTHON = python-pkg/lirc/config.py
    
    if HAVE_PYTHON35
    py_PYTHON += python-pkg/lirc/async_client.py \
    

    It seems like a pretty straightforward fix; could someone apply it, or tell us why it can't be applied?

     
  • Sean Young

    Sean Young - 2023-03-23
    • status: open --> closed
     
  • Sean Young

    Sean Young - 2023-03-23

    Fix merged

     

Log in to post a comment.