import requests.exceptions # this is required due to github issue, to ensure we don't lose perf from openPySSL: https://github.com/pyca/pyopenssl/issues/625 enforce_no_py_open_ssl = None try: from requests.packages.urllib3.contrib.pyopenssl import extract_from_urllib3 as enforce_no_py_open_ssl except ImportError: # in the case of debian/ubuntu system packages, the import is slightly different try: from urllib3.contrib.pyopenssl import extract_from_urllib3 as enforce_no_py_open_ssl except ImportError: # if OpenSSL is unavailable in both cases then there is no need to "undo" it. pass if enforce_no_py_open_ssl: enforce_no_py_open_ssl() from .exceptions import DatalakeBadOffsetException, DatalakeRESTException from .exceptions import FileNotFoundError, PermissionError from . import __version__ logger = logging.getLogger(__name__) # TODO: This client id should be removed and it should be a required parameter for authentication. default_client = os.environ.get('azure_client_id', "04b07795-8ddb-461a-bbee-02f9e1bf7b46") default_store = os.environ.get('azure_data_lake_store_name', None) default_adls_suffix = os.environ.get('azure_data_lake_store_url_suffix', 'azuredatalakestore.net') # Constants DEFAULT_RESOURCE_ENDPOINT = "https://datalake.azure.net/" MAX_CONTENT_LENGTH = 2**16
import requests.exceptions # this is required due to github issue, to ensure we don't lose perf from openPySSL: https://github.com/pyca/pyopenssl/issues/625 enforce_no_py_open_ssl = None try: from requests.packages.urllib3.contrib.pyopenssl import extract_from_urllib3 as enforce_no_py_open_ssl except ImportError: # in the case of debian/ubuntu system packages, the import is slightly different try: from urllib3.contrib.pyopenssl import extract_from_urllib3 as enforce_no_py_open_ssl except ImportError: # if OpenSSL is unavailable in both cases then there is no need to "undo" it. pass if enforce_no_py_open_ssl: enforce_no_py_open_ssl() from msrest.authentication import Authentication from .exceptions import DatalakeBadOffsetException, DatalakeRESTException from .exceptions import FileNotFoundError, PermissionError from . import __version__ logger = logging.getLogger(__name__) # TODO: This client id should be removed and it should be a required parameter for authentication. default_client = os.environ.get('azure_client_id', "04b07795-8ddb-461a-bbee-02f9e1bf7b46") default_store = os.environ.get('azure_data_lake_store_name', None) default_adls_suffix = os.environ.get('azure_data_lake_store_url_suffix', 'azuredatalakestore.net') # Constants DEFAULT_RESOURCE_ENDPOINT = "https://datalake.azure.net/"