author | John Beck <John.Beck@Oracle.COM> |
Mon, 19 May 2014 07:37:20 -0700 | |
changeset 1907 | 446472de62e9 |
parent 1484 | 01108fd9c6ef |
child 3998 | 5bd484384122 |
permissions | -rw-r--r-- |
1484
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
1 |
This patch file makes two changes: |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
2 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
3 |
1/ Corrects the definition of is_solaris in compat.py. |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
4 |
2/ Adjusts the where() routine in certs.py to return the location |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
5 |
of the standard certs bundle on Solaris. |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
6 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
7 |
These changes have been sent upstream. |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
8 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
9 |
--- requests-1.2.3/requests/compat.py.orig 2013-07-31 07:31:19.545770096 -0700 |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
10 |
+++ requests-1.2.3/requests/compat.py 2013-07-31 07:31:53.534460102 -0700 |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
11 |
@@ -71,7 +71,7 @@ |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
12 |
is_linux = ('linux' in str(sys.platform).lower()) |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
13 |
is_osx = ('darwin' in str(sys.platform).lower()) |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
14 |
is_hpux = ('hpux' in str(sys.platform).lower()) # Complete guess. |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
15 |
-is_solaris = ('solar==' in str(sys.platform).lower()) # Complete guess. |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
16 |
+is_solaris = ('sunos' in str(sys.platform).lower()) |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
17 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
18 |
try: |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
19 |
import simplejson as json |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
20 |
--- requests-1.2.3/requests/certs.py.orig 2013-07-31 07:34:29.859095710 -0700 |
1907
446472de62e9
PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
1484
diff
changeset
|
21 |
+++ requests-1.2.3/requests/certs.py 2014-04-17 08:51:04.868103751 -0700 |
1484
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
22 |
@@ -13,12 +13,15 @@ |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
23 |
""" |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
24 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
25 |
import os.path |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
26 |
- |
1907
446472de62e9
PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
1484
diff
changeset
|
27 |
+from requests import compat |
1484
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
28 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
29 |
def where(): |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
30 |
"""Return the preferred certificate bundle.""" |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
31 |
# vendored bundle inside Requests |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
32 |
- return os.path.join(os.path.dirname(__file__), 'cacert.pem') |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
33 |
+ if compat.is_solaris: |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
34 |
+ return "/etc/certs/ca-certificates.crt" |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
35 |
+ else: |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
36 |
+ return os.path.join(os.path.dirname(__file__), 'cacert.pem') |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
37 |
|
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
38 |
if __name__ == '__main__': |
01108fd9c6ef
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
39 |
print(where()) |