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

krita: fix scripts not working with python3.13 #53965

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 53 additions & 3 deletions srcpkgs/krita/patches/python-3.13.patch
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,56 @@ index fb309bd0b8..aec47da239 100644
*/
static bool setPath(const QStringList& scriptPaths);

--
2.45.2

diff --git a/plugins/extensions/pykrita/plugin/krita/excepthook.py b/plugins/extensions/pykrita/plugin/krita/excepthook.py
index 029d5d3cb93..dfaeb560a37 100644
--- a/plugins/extensions/pykrita/plugin/krita/excepthook.py
+++ b/plugins/extensions/pykrita/plugin/krita/excepthook.py
@@ -11,7 +11,7 @@ Things to extend: Clicking on the filename should open an editor.
Things to consider: Mail exceptions, copy to clipboard or send to bug tracker.
"""
import sys
-import cgitb
+import traceback
import atexit

from PyQt5.QtCore import pyqtSlot, Qt
@@ -61,7 +61,7 @@ class ExceptHookDialog(QDialog):
self.setWindowTitle(self.windowTitle() + ": " + title)
msg = "%s: %s" % (exc_type.__name__, exc_obj)
self.ui.exceptionLabel.setText(msg)
- html = cgitb.text((exc_type, exc_obj, exc_tb))
+ html = traceback.format_exception(exc_type, exc_obj, exc_tb).splitlines()
self.ui.tracebackBrowser.setText(html)
self.resize(650, 350) # give enough space to see the backtrace better

@@ -74,7 +74,7 @@ if __name__ == "__main__":
# Some tests:
app = QApplication(sys.argv)
install()
- print("Triggering error 1")
+ print("Triggering error 1")f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really have an f here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch likely created twice, and apply directly on each other, please change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a major reason we don't want submitters skipping CI. Remove the [ci skip] from your comment and let our tests do their jobs.

try:
fail = 1 / 0
except:
diff --git a/plugins/extensions/pykrita/plugin/krita/excepthook.py b/plugins/extensions/pykrita/plugin/krita/excepthook.py
index dfaeb560a37..a6b7fafc4f6 100644
--- a/plugins/extensions/pykrita/plugin/krita/excepthook.py
+++ b/plugins/extensions/pykrita/plugin/krita/excepthook.py
@@ -61,7 +61,7 @@ class ExceptHookDialog(QDialog):
self.setWindowTitle(self.windowTitle() + ": " + title)
msg = "%s: %s" % (exc_type.__name__, exc_obj)
self.ui.exceptionLabel.setText(msg)
- html = traceback.format_exception(exc_type, exc_obj, exc_tb).splitlines()
+ html = "\n".join(traceback.format_exception(exc_type, exc_obj, exc_tb))
self.ui.tracebackBrowser.setText(html)
self.resize(650, 350) # give enough space to see the backtrace better

@@ -74,7 +74,7 @@ if __name__ == "__main__":
# Some tests:
app = QApplication(sys.argv)
install()
- print("Triggering error 1")f
+ print("Triggering error 1")
try:
fail = 1 / 0
except:
2 changes: 1 addition & 1 deletion srcpkgs/krita/template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Template file for 'krita'
pkgname=krita
version=5.2.6
revision=2
revision=3
build_style=cmake
configure_args="-Wno-dev -DBUILD_TESTING=OFF -DENABLE_UPDATERS=OFF"
hostmakedepends="extra-cmake-modules gettext pkg-config python3
Expand Down
Loading