mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-07 05:12:58 +02:00
brltty: fix segfault when built with Cython 3
https://discourse.gnome.org/t/psa-for-distros-brltty-should-be-built-using-cython-0-29-x-not-cython-3/16715/3i
This commit is contained in:
parent
948cac7d74
commit
3f86840ce7
2 changed files with 45 additions and 1 deletions
44
srcpkgs/brltty/patches/cython3.patch
Normal file
44
srcpkgs/brltty/patches/cython3.patch
Normal file
|
@ -0,0 +1,44 @@
|
|||
From e6707d5e094dc36db4319ce4d052a6ad568a5d26 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||
Date: Tue, 15 Aug 2023 16:29:13 +0200
|
||||
Subject: [PATCH] brlapi: Fix python crash on connection error
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From Lukáš Tyrychtr:
|
||||
“
|
||||
Cython 3.0 started using the new Python object finalization APIs from PEP 442
|
||||
”
|
||||
|
||||
This means that __del__ gets called even when raising an exception from
|
||||
__init__, while it was not before. To cope with both behaviors, we can
|
||||
set self.h to NULL to determine whether it still exists or not.
|
||||
|
||||
Thanks Lukáš Tyrychtr for the investigation and patch draft!
|
||||
---
|
||||
Bindings/Python/brlapi.pyx | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Bindings/Python/brlapi.pyx b/Bindings/Python/brlapi.pyx
|
||||
index 0136895eaf..af62cc9be0 100644
|
||||
--- a/Bindings/Python/brlapi.pyx
|
||||
+++ b/Bindings/Python/brlapi.pyx
|
||||
@@ -453,6 +453,7 @@ cdef class Connection:
|
||||
c_brlapi.brlapi_protocolExceptionInit(self.h)
|
||||
if self.fd == -1:
|
||||
c_brlapi.free(self.h)
|
||||
+ self.h = NULL
|
||||
raise ConnectionError(self.settings.host, self.settings.auth)
|
||||
|
||||
def closeConnection(self):
|
||||
@@ -465,7 +466,8 @@ cdef class Connection:
|
||||
"""Release resources used by the connection"""
|
||||
if self.fd != -1:
|
||||
c_brlapi.brlapi__closeConnection(self.h)
|
||||
- c_brlapi.free(self.h)
|
||||
+ if self.h != NULL:
|
||||
+ c_brlapi.free(self.h)
|
||||
|
||||
property host:
|
||||
"""To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application."""
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'brltty'
|
||||
pkgname=brltty
|
||||
version=6.4
|
||||
revision=10
|
||||
revision=11
|
||||
build_style=gnu-configure
|
||||
build_helper=python3
|
||||
configure_args="--enable-gpm --with-screen-driver=lx,sc
|
||||
|
|
Loading…
Add table
Reference in a new issue