This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 658
Conflict with httplib2 #703
Comments
It turns out this is only an issue with raven-python/raven/transport/eventlet.py Line 14 in 356a7c4
which eventually imports https://github.com/eventlet/eventlet/blob/49773bb12b84e10ccb0a199c301f97fd6528ab68/eventlet/green/httplib.py#L16 which causes the check here to fail https://github.com/jcgregorio/httplib2/blob/cf631a73e2f3f43897b65206127ced82382d35f5/python3/httplib2/__init__.py#L1366 because httplib2 imported http.client before it was replaced by an identical version by eventlet. The simple fix is to import raven before importing httplib2 /twilio .
|
Eventlet bug report: eventlet/eventlet#316 |
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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. [1] getsentry/raven-python#703 [2] #316 This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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 originl 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. [1] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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 originl 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. [1] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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 originl 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. [1] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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 originl 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. [1] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jun 15, 2016
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 originl 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. [1] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jul 8, 2016
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 originl 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] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
jstasiak
added a commit
to eventlet/eventlet
that referenced
this issue
Jul 8, 2016
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] getsentry/raven-python#703 [2] #316 [3] https://docs.python.org/3/library/re.html#re.fullmatch This patch is contributed by Smarkets Limited.
FYI this is fixed in Eventlet master branch and should be released fairly soon. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Found this because of a strange exception when integrating with Celery and making HTTP requests, but there's a simpler reproduction scenario. Here's my example program:
And here's the output:
The very act of importing
raven.Client
causes httplib2 to stop working. In my case, it surfaced as a mysterious error deep inside the Twilio client, which I'll paste below in case someone else googles for it.This is using Python 3.4.3, raven==5.9.0, and httplib2==0.9.2, all of which appear to be the latest.
That Twilio library exception:
The text was updated successfully, but these errors were encountered: