Bug#914752: opencv: FTBFS against python3.7.1: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]

Gilles Filippini pini at debian.org
Tue Nov 27 21:24:44 GMT 2018


Control: tags -1 + patch

On Mon, 26 Nov 2018 23:49:37 +0100 Gilles Filippini <pini at debian.org> wrote:
> Source: opencv
> Version: 3.2.0+dfsg-4.1+b1
> Severity: serious
> Tags: ftbfs
> Justification: FTBFS
> 
> Hi,
> 
> OpenCV FTBFS aginst python3.7.1 which is transitioning as default for python3:
> 
> /build/opencv-mrTo2C/opencv-3.2.0+dfsg/modules/python/src2/cv2.cpp:730:34: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
>      char* str = PyString_AsString(obj);

Patch attached.

Thanks,

_g.
-------------- next part --------------
diff -Nru opencv-3.2.0+dfsg/debian/changelog opencv-3.2.0+dfsg/debian/changelog
--- opencv-3.2.0+dfsg/debian/changelog	2018-07-11 22:59:18.000000000 +0200
+++ opencv-3.2.0+dfsg/debian/changelog	2018-11-27 20:51:21.000000000 +0100
@@ -1,3 +1,10 @@
+opencv (3.2.0+dfsg-4.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/patches: Fix building with python3.7.1 (Closes: #914752)
+
+ -- Gilles Filippini <pini at debian.org>  Tue, 27 Nov 2018 20:51:21 +0100
+
 opencv (3.2.0+dfsg-4.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru opencv-3.2.0+dfsg/debian/patches/python3.7.1.patch opencv-3.2.0+dfsg/debian/patches/python3.7.1.patch
--- opencv-3.2.0+dfsg/debian/patches/python3.7.1.patch	1970-01-01 01:00:00.000000000 +0100
+++ opencv-3.2.0+dfsg/debian/patches/python3.7.1.patch	2018-11-27 20:50:47.000000000 +0100
@@ -0,0 +1,13 @@
+Index: opencv-3.2.0+dfsg/modules/python/src2/cv2.cpp
+===================================================================
+--- opencv-3.2.0+dfsg.orig/modules/python/src2/cv2.cpp
++++ opencv-3.2.0+dfsg/modules/python/src2/cv2.cpp
+@@ -727,7 +727,7 @@ bool pyopencv_to(PyObject* obj, String&
+     (void)name;
+     if(!obj || obj == Py_None)
+         return true;
+-    char* str = PyString_AsString(obj);
++    const char* str = PyString_AsString(obj);
+     if(!str)
+         return false;
+     value = String(str);
diff -Nru opencv-3.2.0+dfsg/debian/patches/series opencv-3.2.0+dfsg/debian/patches/series
--- opencv-3.2.0+dfsg/debian/patches/series	2018-07-11 22:59:18.000000000 +0200
+++ opencv-3.2.0+dfsg/debian/patches/series	2018-11-27 20:51:11.000000000 +0100
@@ -6,3 +6,4 @@
 disable_dnn.patch
 fix_VFP_asm.patch
 ffmpeg4.0.patch
+python3.7.1.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20181127/0abf6cf7/attachment-0001.sig>


More information about the debian-science-maintainers mailing list