Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
fc366c188e
!36 [sync] PR-34: Since Python 3.3, mock is part of unittest in the standard library
From: @openeuler-sync-bot 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-28 12:29:21 +00:00
fandehui
756583ed57 Use mock from the standard library
Since Python 3.3, mock is part of unittest in the standard library.

Provide compatibility for older versions, since httplib2 seems to still
support Python2.

Signed-off-by: fandehui <fandehui@xfusion.com>
(cherry picked from commit 151380e3dd1e3e7e6553a4d739df66d02f6b0fbc)
2023-12-28 15:19:13 +08:00
openeuler-ci-bot
3b308212b4 !15 python3-httplib2 provides python-httplib2
From: @jpzhang187
Reviewed-by: @lyn1001,@small_leek
Signed-off-by: @small_leek
2021-03-31 15:00:34 +08:00
jpzhang187
5a8460b72d python3-httplib2 provides python-httplib2 2021-03-31 10:11:00 +08:00
openeuler-ci-bot
1f23e9c6fb !12 [sync] PR-9: update to 0.19.0 to fix CVE-2021-21240
From: @openeuler-sync-bot
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-03-03 15:53:08 +08:00
zhanghua1831
d78a0959b0 update to 0.19.0 to fix CVE-2021-21240
(cherry picked from commit 9390a178037466d63700c52eeefd77de9907d29d)
2021-03-03 14:53:36 +08:00
openeuler-ci-bot
d2686d2d74 !6 Add yaml file and fix CVE-2020-11078
Merge pull request !6 from wangxiao65/openEuler-20.03-LTS
2020-07-21 19:20:54 +08:00
wangxiao65
f7c6ca85c8 Add yaml file and fix CVE-2020-11078 2020-07-21 09:41:30 +08:00
openeuler-ci-bot
488fce5e87 !3 Repackage
Merge pull request !3 from hy/work
2020-01-14 16:05:34 +08:00
eulerstorage
09c1263849 Delete the useless patch 2020-01-14 15:11:39 +08:00
6 changed files with 117 additions and 46 deletions

View File

@ -0,0 +1,93 @@
From f88fe0a1142f71215fea95be9900eaecb546f7b5 Mon Sep 17 00:00:00 2001
From: Pavel Cahyna <pcahyna@redhat.com>
Date: Wed, 3 Mar 2021 22:07:25 +0100
Subject: [PATCH] Use mock from the standard library
Since Python 3.3, mock is part of unittest in the standard library.
Provide compatibility for older versions, since httplib2 seems to still
support Python2.
---
requirements-test.txt | 2 +-
tests/test_cacerts_from_env.py | 5 ++++-
tests/test_http.py | 5 ++++-
tests/test_other.py | 5 ++++-
tests/test_proxy.py | 5 ++++-
5 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/requirements-test.txt b/requirements-test.txt
index d208a8f..623875e 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,6 +1,6 @@
flake8==3.4.1
future==0.16.0
-mock==2.0.0
+mock==2.0.0;python_version<"3.3"
pytest-cov==2.5.1
pytest-forked==0.2
pytest-randomly==1.2.1
diff --git a/tests/test_cacerts_from_env.py b/tests/test_cacerts_from_env.py
index cb2bd9f..f04ba0e 100644
--- a/tests/test_cacerts_from_env.py
+++ b/tests/test_cacerts_from_env.py
@@ -1,6 +1,9 @@
import os
import sys
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import pytest
import tempfile
import httplib2
diff --git a/tests/test_http.py b/tests/test_http.py
index f61992c..65bac01 100644
--- a/tests/test_http.py
+++ b/tests/test_http.py
@@ -5,7 +5,10 @@ from __future__ import print_function
import email.utils
import errno
import httplib2
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import os
import pytest
from six.moves import http_client, urllib
diff --git a/tests/test_other.py b/tests/test_other.py
index 0f450ab..6b902b9 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -1,5 +1,8 @@
import httplib2
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import os
import pickle
import pytest
diff --git a/tests/test_proxy.py b/tests/test_proxy.py
index edafe01..556b448 100644
--- a/tests/test_proxy.py
+++ b/tests/test_proxy.py
@@ -9,7 +9,10 @@ from __future__ import division
from __future__ import print_function
import httplib2
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import os
import pytest
import socket
--
2.27.0

Binary file not shown.

BIN
httplib2-0.19.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,41 +0,0 @@
diff -Nur httplib2-0.13.0.orig/python2/httplib2/certs.py httplib2-0.13.0/python2/httplib2/certs.py
--- httplib2-0.13.0.orig/python2/httplib2/certs.py 2019-06-06 12:46:32.000000000 -0700
+++ httplib2-0.13.0/python2/httplib2/certs.py 2019-06-30 14:29:14.050085981 -0700
@@ -23,6 +23,7 @@
os.path.dirname(os.path.abspath(__file__)), "cacerts.txt"
)
+FEDORA_CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt"
def where():
env = os.environ.get("HTTPLIB2_CA_CERTS")
@@ -35,7 +36,7 @@
return custom_ca_locater_where()
if certifi_available:
return certifi_where()
- return BUILTIN_CA_CERTS
+ return FEDORA_CA_CERTS
if __name__ == "__main__":
diff -Nur httplib2-0.13.0.orig/python3/httplib2/certs.py httplib2-0.13.0/python3/httplib2/certs.py
--- httplib2-0.13.0.orig/python3/httplib2/certs.py 2019-06-06 12:46:32.000000000 -0700
+++ httplib2-0.13.0/python3/httplib2/certs.py 2019-06-30 14:29:38.778214191 -0700
@@ -23,6 +23,8 @@
os.path.dirname(os.path.abspath(__file__)), "cacerts.txt"
)
+FEDORA_CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt"
+
def where():
env = os.environ.get("HTTPLIB2_CA_CERTS")
@@ -35,7 +37,7 @@
return custom_ca_locater_where()
if certifi_available:
return certifi_where()
- return BUILTIN_CA_CERTS
+ return FEDORA_CA_CERTS
if __name__ == "__main__":

View File

@ -1,13 +1,11 @@
Name: python-httplib2
Version: 0.13.1
Version: 0.19.0
Release: 3
Summary: Small, fast HTTP client library for Python.
License: MIT
URL: https://github.com/httplib2/httplib2
Source0: https://files.pythonhosted.org/packages/78/23/bb9606e87a66fd8c72a2b1a75b049d3859a122bc2648915be845bc44e04f/httplib2-0.13.1.tar.gz
Patch1: python-httplib2.certfile.patch
Source0: https://files.pythonhosted.org/packages/ed/ef/f0e05d5886a9c25dea4b18be06cd7bcaddbae0168cc576f3568f9bd6a35a/httplib2-0.19.0.tar.gz
Patch0: Use-mock-from-the-standard-library.patch
BuildRequires: python2-setuptools python2-devel
%if 0%{?with_python3}
@ -30,6 +28,7 @@ Small, fast HTTP client library for Python.
%if 0%{?with_python3}
%package -n python3-httplib2
Summary: Small, fast HTTP client library for Python.
%{?python_provide:%python_provide python3-httplib2}
%description -n python3-httplib2
Small, fast HTTP client library for Python.
@ -73,6 +72,22 @@ popd
%endif
%changelog
* Wed Dec 27 2023 fandehui <fandehui@xfusion.com> - 0.19.0-3
- Use mock from the standard library
* Wed Mar 31 2021 zhangjiapeng <zhangjiapeng9@huawei.com> - 0.19.0-2
- python3-httplib2 provides python-httplib2
* Tue Mar 2 2021 zhanghua <zhanghua40@huawei.com> - 0.19.0-1
- update to 0.19.0 to fix CVE-2021-21240
* Mon Jul 20 2020 wangxiao <wangxiao65@huawei.com> - 0.13.1-5
- add yaml file
- fix CVE-2020-11078
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-4
- Delete the useless patch
* Fri Jan 10 2020 gulining <gulining1@huawei.com> - 0.13.1-3
- Change the URL to a valid one

4
python-httplib2.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: pypi
src_repo: httplib2
tag_prefix: "^v"
seperator: "."