kennethreitz/requests — pull request #1221 by sirboderafael (2013-02-28 02:38:06+00:00)
Title: I do not this behavior should be in master branch

Installing requests from pip gives me the following error:

Unpacking ./requests/requests-1.0.4.zip
Running setup.py egg_info for package from file:///home/fclbot/requests/requests-1.0.4.zip
Traceback (most recent call last):
File "", line 14, in
File "/tmp/pip-a6e6xF-build/setup.py", line 6, in
import requests
File "requests/__init__.py", line 52, in
from . import utils
File "requests/utils.py", line 22, in
from .compat import parse_http_list as _parse_list_header
File "requests/compat.py", line 7, in
from .packages import charade as chardet
File "requests/packages/__init__.py", line 3, in
from . import urllib3
File "requests/packages/urllib3/__init__.py", line 16, in
from .connectionpool import (
File "requests/packages/urllib3/connectionpool.py", line 45, in
from .util import get_host, is_connection_dropped, ssl_wrap_socket
File "requests/packages/urllib3/util.py", line 293, in
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE,
NameError: name 'CERT_NONE' is not defined
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 14, in

File "/tmp/pip-a6e6xF-build/setup.py", line 6, in

import requests

File "requests/__init__.py", line 52, in

from . import utils

File "requests/utils.py", line 22, in

from .compat import parse_http_list as _parse_list_header

File "requests/compat.py", line 7, in

from .packages import charade as chardet

File "requests/packages/__init__.py", line 3, in

from . import urllib3

File "requests/packages/urllib3/__init__.py", line 16, in

from .connectionpool import (

File "requests/packages/urllib3/connectionpool.py", line 45, in

from .util import get_host, is_connection_dropped, ssl_wrap_socket

File "requests/packages/urllib3/util.py", line 293, in

def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=CERT_NONE,

NameError: name 'CERT_NONE' is not defined

----------------------------------------

This fix is a simple comment over buggy code, so this error would not happen again until you fix it in a proper way.

It is exactly the same as discussed in: http://stackoverflow.com/questions/14919557/how-to-get-urllib3-and-requests-working-with-jython-2-7-beta-1

Important: It does not applies only to jython users, but python users are being affected by this error too.