deb-python-eventlet/eventlet/green/urllib
Jakub Stasiak c93279086c Provide green http without undesired side effects
The Eventlet patcher and the way we were patching multi-level http
package don't work well[1][2]. I spent a lot of time trying to make it
work but in the end every solution I came up with was breaking something
else and made the patching and providing green http even more
complicated - I wouldn't envy anyone having to debug it in the future.

After a lot of thinking I decided having our own copy of http with the
necessary modifications applied seems like the most straightforward and
the most reliable solution, even considering its downsides (we need to
keep it up to date ourselves and the API won't 100 % match the regular
http module API on older Python 3 versions as our bundled version is the
most recent one and has bug fixes and extra features implemented).

The code introduces by this commit comes from the following Python
commit (development branch):

commit 6251d66ba9a692d3adf5d2e6818b29ac44130787
Author: Xavier de Gaye <xdegaye@users.sourceforge.net>
Date:   2016-06-15 11:35:29 +0200

    Issue #26862: SYS_getdents64 does not need to be defined on android
    API 21.

Changes to the original http package code involve:

* Removing unnecessary import(s)
* Replacing some regular imports with eventlet.green imports
* Replacing fullmatch()[3] usage with match() so we stay Python 3.3
  compatible

I left urllib.parse imports intact as nothing there performs IO.

Green httplib module is also modified because it used to import
http.client using patcher which was breaking things the same way.

A new dependency, enum-compat, is added to ensure that the enum module
is present on Python 3.3 (the http package code comes the latest Python
development branch and uses enum).

[1] https://github.com/getsentry/raven-python/issues/703
[2] https://github.com/eventlet/eventlet/issues/316
[3] https://docs.python.org/3/library/re.html#re.fullmatch

This patch is contributed by Smarkets Limited.
2016-07-08 16:06:23 +02:00
..
__init__.py Python 3 compat: Fix all Travis test failures 2015-02-13 08:52:54 +01:00
error.py Python 3 compat: Fix all Travis test failures 2015-02-13 08:52:54 +01:00
parse.py Python 3 compat: Fix all Travis test failures 2015-02-13 08:52:54 +01:00
request.py Provide green http without undesired side effects 2016-07-08 16:06:23 +02:00
response.py Python 3 compat: Fix all Travis test failures 2015-02-13 08:52:54 +01:00