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

Breakage with 1.4.0 release (MainWindow has no attribute 'sid'; translator for language code "C") #1535

Closed
graysky2 opened this issue Sep 16, 2023 · 14 comments · Fixed by #1536

Comments

@graysky2
Copy link
Contributor

graysky2 commented Sep 16, 2023

I maintain the backintime AUR package. Simply updating the pkgver to 1.4.0 and removing the python-311.patch allows building but the resulting compiled package fails to load:

% backintime-qt

Back In Time
Version: 1.4.0

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

WARNING: PyQt was not able to install a translator for language code "C". Deactivate translation and falling back to the source language (English).
Traceback (most recent call last):
  File "/usr/share/backintime/qt/app.py", line 1280, in btnShowHiddenFilesToggled
    self.updateFilesView(1)
  File "/usr/share/backintime/qt/app.py", line 1597, in updateFilesView
    if self.sid.isRoot:
       ^^^^^^^^
AttributeError: 'MainWindow' object has no attribute 'sid'
/usr/bin/backintime-qt: line 31: 68419 Aborted                 (core dumped) python -Es ${APP_PATH}/app.py "$@"

To help us diagnose the problem quickly, please provide the output of the console command backintime --diagnostics.

% backintime --diagnostics
{
    "backintime": {
        "name": "Back In Time",
        "version": "1.4.0",
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": true,
        "global-config-file": "/etc/backintime/config",
        "global-config-file-found": false,
        "started-from": "/usr/share/backintime/common",
        "running-as-root": false,
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "platform": "Linux-6.5.3-1-minimum-x86_64-with-glibc2.38",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Wed Sep 13 16:15:39 EDT 2023",
        "OS": {
            "/etc/os-release": "Arch Linux",
            "/etc/arch-release": ""
        },
        "display-system": "x11",
        "locale": "en_US, UTF-8",
        "PATH": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.11.5 main Sep  2 2023 14:16:33 CPython GCC 13.2.1 20230801",
        "python-executable": "/usr/bin/python",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.11",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/lib/python311.zip",
            "/usr/lib/python3.11",
            "/usr/lib/python3.11/lib-dynload",
            "/usr/lib/python3.11/site-packages"
        ],
        "qt": {
            "Version": "PyQt 5.15.9 / Qt 5.15.8",
            "Theme": "oxygen",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.local/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.2.7",
            "protocol": "31.0",
            "capabilities": {
                "file_bits": 64,
                "inum_bits": 64,
                "timestamp_bits": 64,
                "long_int_bits": 64,
                "socketpairs": true,
                "symlinks": true,
                "symtimes": true,
                "hardlinks": true,
                "hardlink_specials": true,
                "hardlink_symlinks": true,
                "IPv6": true,
                "atimes": true,
                "batchfiles": true,
                "inplace": true,
                "append": true,
                "ACLs": true,
                "xattrs": true,
                "secluded_args": "optional",
                "iconv": true,
                "prealloc": true,
                "stop_at": true,
                "crtimes": false
            },
            "optimizations": {
                "SIMD_roll": true,
                "asm_roll": false,
                "openssl_crypto": true,
                "asm_MD5": false
            },
            "checksum_list": [
                "xxh128",
                "xxh3",
                "xxh64",
                "md5",
                "md4",
                "sha1",
                "none"
            ],
            "compress_list": [
                "zstd",
                "lz4",
                "zlibx",
                "zlib",
                "none"
            ],
            "daemon_auth_list": [
                "sha512",
                "sha256",
                "sha1",
                "md5",
                "md4"
            ]
        },
        "ssh": "OpenSSH_9.4p1, OpenSSL 3.1.2 1 Aug 2023",
        "sshfs": "(no sshfs)",
        "encfs": "(no encfs)",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)"
    }
}
@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

Hi Graysky,
thanks for reporting back. I'll look into it.

@aryoda
Copy link
Contributor

aryoda commented Sep 16, 2023

@graysky2 Could you please provide the output of backintime-qt --debug too (anonymize paths and user name if applicable) since we need to find the execution path that is causing the non-initialized self.sid variable. THX!

@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

Current state: I wasn't able to reproduce on Manjaro, Debian 12 and Fedora. But I have a trail.

@graysky2
Copy link
Contributor Author

You bet:

% backintime-qt --debug
DEBUG: [common/backintime.py:589 argParse] Arguments: {'debug': True} | unknownArgs: []

Back In Time
Version: 1.4.0

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Main profile
DEBUG: [common/tools.py:174 initiate_translation] No language code. Use systems current locale.
DEBUG: [common/backintime.py:677 getConfig] config file: /home/facade/.config/backintime/config
DEBUG: [common/backintime.py:678 getConfig] share path: /home/facade/.local/share/backintime
DEBUG: [common/backintime.py:679 getConfig] profiles: 1=Main profile
DEBUG: [common/pluginmanager.py:245 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:262 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/tools.py:719 is_Qt5_working] Qt5 probing result: exit code 2
DEBUG: [plugins/systrayiconplugin.py:76 init] System tray is available to show the BiT system tray icon
DEBUG: [common/pluginmanager.py:262 PluginManager.load] Add plugin systrayiconplugin.py
DEBUG: [qt/qttools.py:229 createQApplication] QT QPA platform plugin: xcb
DEBUG: [qt/qttools.py:230 createQApplication] QT_QPA_PLATFORMTHEME=<not set>
DEBUG: [qt/qttools.py:235 createQApplication] QT_STYLE_OVERRIDE=<not set>
DEBUG: [qt/qttools.py:238 createQApplication] QT active style: fusion
DEBUG: [qt/qttools.py:239 createQApplication] QT fallback style:
DEBUG: [qt/qttools.py:240 createQApplication] QT supported styles: ['Windows', 'Fusion']
DEBUG: [qt/qttools.py:241 createQApplication] themeSearchPaths: ['/home/facade/.local/share/icons', '/usr/share/icons', ':/icons']
DEBUG: [qt/qttools.py:242 createQApplication] fallbackSearchPaths: []
DEBUG: [qt/qttools.py:247 createQApplication] Is SystemTray available: True
DEBUG: [qt/qttools.py:264 createQApplication] Trying to set App ID for non-privileged user
DEBUG: [qt/qttools.py:304 initiate_translator] No language code. Use systems current locale.
WARNING: [qt/qttools.py:312 initiate_translator] PyQt was not able to install a translator for language code "C". Deactivate translation and falling back to the source language (English).
DEBUG: [qt/icon.py:20 <module>] Checking if the current theme contains the BiT icon...
DEBUG: [qt/icon.py:32 <module>] Found an installed theme: oxygen
Traceback (most recent call last):
  File "/usr/share/backintime/qt/app.py", line 1280, in btnShowHiddenFilesToggled
    self.updateFilesView(1)
  File "/usr/share/backintime/qt/app.py", line 1597, in updateFilesView
    if self.sid.isRoot:
       ^^^^^^^^
AttributeError: 'MainWindow' object has no attribute 'sid'
/usr/bin/backintime-qt: line 31: 721612 Aborted                 (core dumped) python -Es ${APP_PATH}/app.py "$@"

@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

Reproduced it. First start shouldn't raise an Error. Toggle the "Show Hidden Files" button and restart BIT.

@aryoda aryoda changed the title Breakage with 1.4.0 release Breakage with 1.4.0 release (MainWindow has no attribute 'sid'; translator for language code "C") Sep 16, 2023
@aryoda
Copy link
Contributor

aryoda commented Sep 16, 2023

Reproduced it. First start shouldn't raise an Error. Toggle the "Show Hidden Files" button and restart BIT.

@buhtz
I couldn't. How is the config and language setting constellation for that?

I am just looking into the 2nd problem (self.sid attribute missing): It looks like some unknown config constellation triggers to the btnShowHiddenFilesToggled before self.sid is set in app.__init__() because the actions are connect earlier than self.sid is set... But I still cannot reproduce this part too...

@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

This issue is about "self.sid". There is no problem with the language.
I have a possible solution and will create a PR for testing it.

@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

Explaining the language thing

DEBUG: [common/tools.py:174 initiate_translation] No language code. Use systems current locale.
...
DEBUG: [qt/qttools.py:304 initiate_translator] No language code. Use systems current locale.
WARNING: [qt/qttools.py:312 initiate_translator] PyQt was not able to install a translator for language code "C". Deactivate translation and falling back to the source language (English).

The first DEBUG entry is created before the config was loaded. No problem.
At the second the config was loaded but no explicit language for BIT setup in its config. So the systems locale is used.
The third entry (WARNING) show us "C" as language code. So I assume that Graysky used a testing environment, a container or something like that. Maybe he explicit set locale to C.
The output is usual and as expected.

It can happen that the German language for BIT is installed but not for Qt. In that case you will have a German GUI but with English buttons (Yes instead of Ja).

@graysky2
Copy link
Contributor Author

@buhtz
Copy link
Member

buhtz commented Sep 16, 2023

You patched and did a 1.4.0-1 release in Arch AUR? It is not Arch specific. We fix it upstream. 😄

What is your opinion as distro maintainer?
I assume it is better to fix this upstream in 1.4.1 instead of "re-doing" the 1.4.0 release? ;)

@graysky2
Copy link
Contributor Author

I would just add it and bump to 1.4.1.

@aryoda
Copy link
Contributor

aryoda commented Sep 16, 2023

It can happen that the German language for BIT is installed but not for Qt. In that case you will have a German GUI but with English buttons (Yes instead of Ja).

@buhtz Do we need to update our dependencies documentation for this?

@buhtz
Copy link
Member

buhtz commented Sep 17, 2023

It can happen that the German language for BIT is installed but not for Qt. In that case you will have a German GUI but with English buttons (Yes instead of Ja).

@buhtz Do we need to update our dependencies documentation for this?

I don't see which dependency this should be.

Dear @graysky2 ,
I realized you also mentioned the translation in the subject.
It is not an error and a usual expected behavior. On your test system the qt-translation packages are not installed.

BIT do use two translation systems. GNU gettext for most of the strings produced by our selfs. and Qt translations for standard GUI elements like Yes/No/OK buttons or column headers (e.g. "Size") in file listing widgets. The related packages in Arch could be qt*translation.

I assume that when installing Qt the installation routine on Arch or any other GNU Linux distro somehow recognize the current used locale and install it with it. To my knowledge and IMHO the qt-translation shouldn't be a direct dependency for a backintime package. But of course this is each distro maintainers decission.

@graysky2
Copy link
Contributor Author

graysky2 commented Sep 17, 2023

@buhtz - currently, I do not have qt5-translation as a direct dependency for BIT. I did just add it as an optional one.

@buhtz buhtz added this to the 1.4.1 (upcoming release) milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants