Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in LightDMLayout #43

Open
vantu5z opened this issue May 26, 2022 · 3 comments
Open

Exception in LightDMLayout #43

vantu5z opened this issue May 26, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@vantu5z
Copy link

vantu5z commented May 26, 2022

Environment

  • OS: Arch Linux
  • web-greeter version: 3.4.1-2

Bug description

Try to run: web-greeter --no-sandbox
And get exception:

Traceback (most recent call last):
  File "/usr/lib/web-greeter/bridge/Greeter.py", line 259, in layouts
    return [layout_to_dict(layout) for layout in LightDM.get_layouts()]
  File "/usr/lib/web-greeter/bridge/Greeter.py", line 259, in <listcomp>q
    return [layout_to_dict(layout) for layout in LightDM.get_layouts()]
  File "/usr/lib/web-greeter/bridge/__init__.py", line 48, in layout_to_dict
    "short_description": layout.get_short_description()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 8: unexpected end of data

Fast workaround to fix issue

Edit file: /usr/lib/web-greeter/bridge/__init__.py

def layout_to_dict(layout):
    """Returns a dict from LightDMLayout object"""
    if not layout:
        return {}
    try:
        return {
            "description": layout.get_description(),
            "name": layout.get_name(),
            "short_description": layout.get_short_description()
        }
    except:
        return {}

Additional info

Make some tests.
Get exception on my phonetic and custom layouts if run with ru_RU.utf8 locale.
So if run LANG=en_US.utf8 web-greeter it works fine.

@vantu5z vantu5z added the bug Something isn't working label May 26, 2022
@JezerM
Copy link
Owner

JezerM commented May 26, 2022

Hmm, I didn't expect and even didn't know about these methods throwing an error before. I just added a try-catch around these methods, so it should be fixed now. However, it's weird how this is happening.

Also, I can't reproduce the issue with the Additional info when doing LANG=ru_RU.utf8 web-greeter --debug --no-sandbox; actually, it works fine as you can see here:

Screenshot_20220526_075819

Does this happen only with custom layouts in /etc/lightdm/web-greeter.yml? If so, which layouts are you trying to set? Also, does this occur with other lightdm greeters?

@vantu5z
Copy link
Author

vantu5z commented May 27, 2022

Does this happen only with custom layouts in /etc/lightdm/web-greeter.yml? If so, which layouts are you trying to set?

It happens with default layouts in /etc/lightdm/web-greeter.yml. Try leave only us and set another combinations - have no effect.

Also, does this occur with other lightdm greeters?

Before I use gtk-greeter, then switch to webkit2 - all works fine.

Hmm, I didn't expect and even didn't know about these methods throwing an error before. I just added a try-catch around these methods, so it should be fixed now. However, it's weird how this is happening.

Thanks, it should be fixed now. However, cause stay unknown.

@JezerM
Copy link
Owner

JezerM commented May 28, 2022

Thanks, it should be fixed now. However, cause stay unknown.

Yeah, it's a weird problem. It might be related to PyGObject as lightdm-gtk-greeter doesn't throw this error (as you say).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants