olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.75k stars 232 forks source link

Fedora 38 application crashes when cycling through the home options at first launch #1163

Closed sSola-Why closed 10 months ago

sSola-Why commented 1 year ago

Not sure how to fix the issue

2023-05-05 18:01:33,134 - manuskript.main - INFO - Using the builtin translation. (U.S. English)
2023-05-05 18:01:35,777 - manuskript.logging - CRITICAL - An unhandled exception has occurred!
Traceback (most recent call last):
  File "/usr/share/manuskript/manuskript/ui/welcome.py", line 260, in changeTemplate
    self.updateTemplate()
  File "/usr/share/manuskript/manuskript/ui/welcome.py", line 329, in updateTemplate
    self.updateWordCount()
  File "/usr/share/manuskript/manuskript/ui/welcome.py", line 370, in updateWordCount
    self.template[1][templateIndex][1])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
IndexError: list index out of range
RinasSam commented 1 year ago

Did some testing and here is what I gathered:

  1. Word count does NOT reset after switching templates, and it seems to do "new template word count * old template word count"
  2. This crash always happens when you go from a template with higher levels to a template with lower levels.
  3. It also happens when you add a level then proceed to remove it.
  4. When printing the number of levels to the terminal, it is always n+(n-1) iterations.

Here is the loop that causes the crash:

        # Searching for every spinboxes on the widget, and multiplying
        # their values to get the number of words.
        for s in self.findChildren(QSpinBox, QRegExp(".*"),
                                   Qt.FindChildrenRecursively):
            total = total * s.value()

            # Update self.template to reflect the changed count values
            templateIndex = s.property("templateIndex")
            self.template[1][templateIndex] = (
                s.value(),
                self.template[1][templateIndex][1])

I am not sure if I am correct, but it seems as if s iterates over both the previous and the current widget's levels.

matthewarmand commented 1 year ago

Issue title references Fedora, but I see this in the Arch Linux package as well (0.15.0)

RinasSam commented 1 year ago

Yeah I too got the issue on Arch.

bufalo1973 commented 1 year ago

It also happens on KDE Neon.

charliemartinez commented 9 months ago

Oh yeah, I had opened a similar topic because I didn't realize the problem was the same. Indeed, it also happens to me in Debian, I think it is an error in the program independent of the Linux distribution that is used, perhaps the title of this edition should be updated. I have a question: the issue appears closed, has it been resolved yet? Where can I download an updated .deb? I need to incorporate it into the Quirinux Debian Bassed distribution repository, since Quirinux will come with Manuskript pre-installed and the ISO would become very large if it is included via flatpak. The idea is that Manuskript in Quirinux can be used in live mode. All the best.

TheShadowOfHassen commented 9 months ago

I think the latest version 0.16.1 has the fix. It should be in the releases.

What is Quirinux?

charliemartinez commented 9 months ago

I think the latest version 0.16.1 has the fix. It should be in the releases.

What is Quirinux?

Oh, thank you! I'll check out that release. Quirinux is a distribution for animated film creators, still in development (though nearing release). You can find information on it in this link, although it's in Spanish.

This is our APT repository, where we'll include the updated version of Manuskript if it performs well in our tests:

https://repo.quirinux.org

deb https://repo.quirinux.org/ quirinux main deb-src https://repo.quirinux.org quirinux main

Sign: https://repo.quirinux.org/gpg/quirinux.asc

Quirinux uses its own repository alongside Debian's official ones.

Greetings!