Hello community,
here is the log from the commit of package python-M2Crypto for openSUSE:Factory
checked in at 2020-03-09 11:19:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-M2Crypto (Old)
and /work/SRC/openSUSE:Factory/.python-M2Crypto.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-M2Crypto"
Mon Mar 9 11:19:19 2020 rev:34 rq:782871 version:0.35.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-M2Crypto/python-M2Crypto.changes
2019-06-18 14:48:53.105692413 +0200
+++
/work/SRC/openSUSE:Factory/.python-M2Crypto.new.26092/python-M2Crypto.changes
2020-03-09 11:19:20.608553573 +0100
@@ -1,0 +2,7 @@
+Mon Mar 9 09:56:49 UTC 2020 - Marco Strigl <[email protected]>
+
+- in python3.8 the fp is wrapped in a Buffer. SSL.Connection.makefile
+ returns a socketIO which is no buffer.
+ Added: 001-fix-buffering-for-python38.patch
+
+-------------------------------------------------------------------
New:
----
001-fix-buffering-for-python38.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-M2Crypto.spec ++++++
--- /var/tmp/diff_new_pack.JErfCh/_old 2020-03-09 11:19:21.380554008 +0100
+++ /var/tmp/diff_new_pack.JErfCh/_new 2020-03-09 11:19:21.384554011 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-M2Crypto
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,8 +24,9 @@
Summary: Crypto and SSL toolkit for Python
License: MIT
Group: Development/Languages/Python
-Url: https://gitlab.com/m2crypto/m2crypto
+URL: https://gitlab.com/m2crypto/m2crypto
Source:
https://files.pythonhosted.org/packages/source/M/M2Crypto/M2Crypto-%{version}.tar.gz
+Patch1: 001-fix-buffering-for-python38.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing}
@@ -78,7 +79,9 @@
%prep
%setup -q -n M2Crypto-%{version}
-%autopatch -p1
+%if 0%{?suse_version} > 1500
+%patch1 -p1
+%endif
%build
export CFLAGS="%{optflags}"
++++++ 001-fix-buffering-for-python38.patch ++++++
diff --git a/M2Crypto/SSL/Connection.py b/M2Crypto/SSL/Connection.py
index 7053aa6..6503935 100644
--- a/M2Crypto/SSL/Connection.py
+++ b/M2Crypto/SSL/Connection.py
@@ -12,6 +12,7 @@ Copyright 2008 Heikki Toivonen. All rights reserved.
import logging
import socket
+import io
from M2Crypto import BIO, Err, X509, m2, py27plus, six, util # noqa
from M2Crypto.SSL import Checker, Context, timeout # noqa
@@ -584,7 +585,10 @@ class Connection(object):
def makefile(self, mode='rb', bufsize=-1):
# type: (AnyStr, int) -> socket._fileobject
if six.PY3:
- return socket.SocketIO(self, mode)
+ raw = socket.SocketIO(self, mode)
+ if 'rw' in mode:
+ return io.BufferedRWPair(raw, raw)
+ return io.BufferedReader(raw, io.DEFAULT_BUFFER_SIZE)
else:
return socket._fileobject(self, mode, bufsize)