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

0.10.0 crash using Windows dark mode #659

Closed
mxamber opened this issue Sep 30, 2019 · 5 comments
Closed

0.10.0 crash using Windows dark mode #659

mxamber opened this issue Sep 30, 2019 · 5 comments
Labels
Milestone

Comments

@mxamber
Copy link

mxamber commented Sep 30, 2019

Just downloaded the new 0.10.0 release to both my machines. While it seems to work on my main rig (Windows 7 64-bit), apparently fixing all issues I had experienced with 0.9.0, I can't get it to run on my laptop with the Windows colour scheme set to dark. Starting it results in the following error:

Debug: Web rendering engine used: QWebView
Running manuskript version 0.10.0.
Preferred translation: ['de-DE', 'en-US'] (based on available ui languages)
Loaded translation: manuskript_de_DE.qm
Traceback (most recent call last):
File "manuskript", line 13, in
File "manuskript\main.py", line 231, in run
File "manuskript\main.py", line 142, in prepare
File "manuskript\main.py", line 115, in respectSystemDarkThemeSetting
AttributeError: type object 'GlobalColor' has no attribute 'white'
Failed to execute script manuskript

The machine is running Windows 10 64-bit and a fresh install of Manuskript, having deleted the old instance and installed it anew from the 0.10.0 archive. Deleting it and installing it again didn't fix the issue. Manuskript 0.9.0 previously ran perfectly fine. Changing Windows' colour scheme to bright (which is the default) rather than dark fixed the issue.

@worstje
Copy link
Contributor

worstje commented Sep 30, 2019

Weird. That did not come up during testing. (I feel terrible since I wrote that patch...)

I guess it is due to the version of PyQt bundled with the PyInstaller build. I'll look into it.

Edit 1: I was able to reproduce this. Looking into a fix now.

Edit 2: So apparently Qt.QtCore.GlobalColor does not contain any colors on older PyQt versions, and the documentation of course mentions nothing of the sort. I still should have tested on older versions of Qt (I thought I had, but I guess not old enough?) but who expects those things to just... not exist? 🤦‍♂

Edit 3: The bug happens for PyQt version before 5.11. I know how to fix and will prepare a PR for it ASAP.

worstje added a commit to worstje/manuskript that referenced this issue Sep 30, 2019
QtCore.Qt.GlobalColor does not have any accessors for the predefined
colors on PyQt versions before 5.11 despite the object itself existing.

It would have been nice if the documentation* had mentioned that object
being broken on older versions, but I should have tested with even older
versions of PyQt before submitting the original patch.

Apparently the most supported way to access these colors is through the
Qt namespace itself, but those aren't documented in the slightest. Ugh.

My apologies to all those affected. Fixes issue olivierkes#659.

*: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtcore/qt.html#GlobalColor
@worstje
Copy link
Contributor

worstje commented Sep 30, 2019

@mxamber I am very sorry that you (and likely others) are affected by this bug. I should have caught that; I thought I was distrustful enough of the version differences as it was but apparently I need to be even more paranoid in the future.

I have submitted PR #660 along with the request that @gedakc creates a new Windows build.

(Unfortunately I can't provide a proper Windows build for you myself at this time; if I could I would have provided a download with the fix included.)

@gedakc
Copy link
Collaborator

gedakc commented Oct 1, 2019

A win32 PyInstaller package with PR 660 applied is ready for testing.

https://sourceforge.net/projects/manuskript/files/manuskript/testing-only/

@worstje
Copy link
Contributor

worstje commented Oct 1, 2019

I have tested that new package on my end and the problem has been fixed. 👍

@gedakc gedakc added the bug label Oct 2, 2019
@gedakc gedakc added this to the 0.11.0 milestone Oct 2, 2019
gedakc pushed a commit that referenced this issue Oct 2, 2019
QtCore.Qt.GlobalColor does not have any accessors for the predefined
colors on PyQt versions before 5.11 despite the object itself existing.

It would have been nice if the documentation* had mentioned that object
being broken on older versions, but I should have tested with even older
versions of PyQt before submitting the original patch.

Apparently the most supported way to access these colors is through the
Qt namespace itself, but those aren't documented in the slightest. Ugh.

My apologies to all those affected. Fixes issue #659.

*: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtcore/qt.html#GlobalColor
@gedakc
Copy link
Collaborator

gedakc commented Oct 2, 2019

Closing this issue because PR #660 (which prevents the crash) has been merged with the develop branch.

Further the test package file has been renamed:
manuskript-0.10.0-2-win32.zip
and uploaded to the official release areas.

@gedakc gedakc closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants