author | John Beck <John.Beck@Oracle.COM> |
Fri, 06 Feb 2015 16:51:20 -0800 | |
branch | s11-update |
changeset 3778 | 35735ffdda43 |
parent 2785 | b6f5c5d1d0b7 |
child 3998 | 5bd484384122 |
permissions | -rw-r--r-- |
2785
b6f5c5d1d0b7
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: |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
2 |
|
b6f5c5d1d0b7
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. |
b6f5c5d1d0b7
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 |
b6f5c5d1d0b7
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. |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
6 |
|
b6f5c5d1d0b7
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. |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
8 |
|
b6f5c5d1d0b7
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 |
b6f5c5d1d0b7
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 |
b6f5c5d1d0b7
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 @@ |
b6f5c5d1d0b7
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()) |
b6f5c5d1d0b7
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()) |
b6f5c5d1d0b7
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. |
b6f5c5d1d0b7
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. |
b6f5c5d1d0b7
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()) |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
17 |
|
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
18 |
try: |
b6f5c5d1d0b7
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 |
b6f5c5d1d0b7
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 |
3778
35735ffdda43
PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
2785
diff
changeset
|
21 |
+++ requests-1.2.3/requests/certs.py 2014-04-17 08:51:04.868103751 -0700 |
2785
b6f5c5d1d0b7
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 @@ |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
23 |
""" |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
24 |
|
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
25 |
import os.path |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
26 |
- |
3778
35735ffdda43
PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
2785
diff
changeset
|
27 |
+from requests import compat |
2785
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
28 |
|
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
29 |
def where(): |
b6f5c5d1d0b7
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.""" |
b6f5c5d1d0b7
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 |
b6f5c5d1d0b7
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') |
b6f5c5d1d0b7
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: |
b6f5c5d1d0b7
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" |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
35 |
+ else: |
b6f5c5d1d0b7
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') |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
37 |
|
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
38 |
if __name__ == '__main__': |
b6f5c5d1d0b7
PSARC 2013/140 greenlet version 0.4.0 - Python coroutines module
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
39 |
print(where()) |