Python – urllib3 on python 2.7 SNI error on Google App Engine – iTecNote 您所在的位置:网站首页 urllib3exceptions Python – urllib3 on python 2.7 SNI error on Google App Engine – iTecNote

Python – urllib3 on python 2.7 SNI error on Google App Engine – iTecNote

2023-03-29 01:13| 来源: 网络整理| 查看: 265

Related SolutionsGoogle-app-engine – the difference between Google App Engine and Google Compute Engine

App Engine is a Platform-as-a-Service. It means that you simply deploy your code, and the platform does everything else for you. For example, if your app becomes very successful, App Engine will automatically create more instances to handle the increased volume.

Read more about App Engine

Compute Engine is an Infrastructure-as-a-Service. You have to create and configure your own virtual machine instances. It gives you more flexibility and generally costs much less than App Engine. The drawback is that you have to manage your app and virtual machines yourself.

Read more about Compute Engine

You can mix both App Engine and Compute Engine, if necessary. They both work well with the other parts of the Google Cloud Platform.

EDIT (May 2016):

One more important distinction: projects running on App Engine can scale down to zero instances if no requests are coming in. This is extremely useful at the development stage as you can go for weeks without going over the generous free quota of instance-hours. Flexible runtime (i.e. "managed VMs") require at least one instance to run constantly.

EDIT (April 2017):

Cloud Functions (currently in beta) is the next level up from App Engine in terms of abstraction - no instances! It allows developers to deploy bite-size pieces of code that execute in response to different events, which may include HTTP requests, changes in Cloud Storage, etc.

The biggest difference with App Engine is that functions are priced per 100 milliseconds, while App Engine's instances shut down only after 15 minutes of inactivity. Another advantage is that Cloud Functions execute immediately, while a call to App Engine may require a new instance - and cold-starting a new instance may take a few seconds or longer (depending on runtime and your code).

This makes Cloud Functions ideal for (a) rare calls - no need to keep an instance live just in case something happens, (b) rapidly changing loads where instances are often spinning and shutting down, and possibly more use cases.

Read more about Cloud Functions

Python 3.4 SSL error urlopen error EOF occurred in violation of protocol (_ssl.c:600)

This is the same error as this one: Python Requests requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol

You'll have to use custom HTTPAdapter as stated here: https://stackoverflow.com/a/14146031/407580

>>> import requests >>> from requests.adapters import HTTPAdapter >>> from requests.packages.urllib3.poolmanager import PoolManager >>> import ssl >>> >>> class MyAdapter(HTTPAdapter): ... def init_poolmanager(self, connections, maxsize, block=False): ... self.poolmanager = PoolManager(num_pools=connections, ... maxsize=maxsize, ... block=block, ... ssl_version=ssl.PROTOCOL_TLSv1) ... >>> s = requests.Session() >>> s.mount('https://', MyAdapter()) >>> s.get('https://www.supercash.cz')


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有