Skip to content

[Bug]: Subject: Bug Report – KeyError in Lizmap Plugin 4.5.3+ (server_lwc.py – line 979) #658

@geoartkoszalin

Description

@geoartkoszalin

What is the bug?

Hello,

I would like to report a bug that occurs when using the Lizmap plugin version 4.5.3 and later in QGIS 3.40.4 (Bratislava) with Python 3.12.9 on Windows.

Error details:

While working with the plugin, the following Python error is triggered:

KeyError: 'wersja'
Traceback (most recent call last):
...
File "server_lwc.py", line 979, in _messages_for_version
messages.append(tr('Version {version} not maintained anymore, only for security bugfix only').format(version=branch))
KeyError: 'wersja'

Probable cause:

The error seems to be caused by a mismatch between the placeholder in the original English string ({version}) and its Polish translation ({wersja}), when using .format().

As a result, the .format(version=branch) call fails because the translated string expects a key called {wersja}, which does not exist in the .format() call.

Suggested solutions:

Ensure that the translation keeps the {version} placeholder unchanged, even in translated languages.

Or update the .format() call to match the translated key:
format(wersja=branch) if the translation uses {wersja}.

Using f-strings instead of .format() would also prevent this issue in multilingual environments.

System information:

QGIS version: 3.40.4 (Bratislava)

Lizmap plugin version: 4.5.3 and following

Python version: 3.12.9 (64-bit)

Operating System: Windows

Language setting: Polish

Please let me know if I can provide any additional information, logs, or help with reproducing the issue.

Versions, safeguards, checks summary etc

Best regards,
Artur Studziński

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions