Skip to content

lxmf_cmd does not work, wrong system function call is used causing exception #11

@radio-miskovice

Description

@radio-miskovice

The application never gets to execution of any command because wrong function call causes OSError being thrown.

[2025-11-07 06:57:53] [Debug] LXMF - Call to registered message received callback
[2025-11-07 06:57:53] [Error]    An error occurred in the external delivery callback for <LXMessage bcd6395ce9b0144b5934ea3a1bf5bb48bb1c80e469c211ce6eab5012caf53d30>
[2025-11-07 06:57:53] [Error]    An unhandled <class 'OSError'> exception occurred: [Errno 6] No such device or address
[2025-11-07 06:57:53] [Error]    Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/LXMF/LXMRouter.py", line 1787, in lxmf_delivery
    self.__delivery_callback(message)
  File "/home/dietpi/LXMF-Tools/lxmf_cmd/lxmf_cmd.py", line 653, in process_lxmf_message_propagated
    self.message_received_callback(message)
  File "/home/dietpi/LXMF-Tools/lxmf_cmd/lxmf_cmd.py", line 832, in lxmf_message_received_callback
    content_prefix = replace(content_prefix)
                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dietpi/LXMF-Tools/lxmf_cmd/lxmf_cmd.py", line 854, in replace
    text = text.replace("!user!", os.getlogin())
                                  ^^^^^^^^^^^^^
OSError: [Errno 6] No such device or address

The issue is described here: python/cpython#84998

Instead, it is recommended to use getpass.getuser()

My environment:
DietPi Linux 6.1.115-vendor-rk35xx #1 aarch64
Python 3.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions