Skip to content

Conversation

@martynsmith
Copy link
Contributor

When I try to import pusher on my GAE project, I'm getting a stack trace something like this:

  ...
  File "my-project/mymodule.py", line 10, in <module>
    from pusher import Pusher
  File "lib/pusher/__init__.py", line 3, in <module>
    from .pusher import Pusher
  File "lib/pusher/pusher.py", line 7, in <module>
    from pusher.requests import RequestsBackend
  File "lib/pusher/requests.py", line 12, in <module>
    import urllib3.contrib.pyopenssl
  File "lib/urllib3/contrib/pyopenssl.py", line 48, in <module>
    from ndg.httpsclient.ssl_peer_verification import SUBJ_ALT_NAME_SUPPORT
ImportError: No module named ndg.httpsclient.ssl_peer_verification

This seems to be some issue around GAE not including the necessary modules that RequestsBackend requires.

This patch changes the default backend behaviour such that it only imports the default if one wasn't specified in the constructor (avoiding this issue for GAE users, and potentially others that don't have requests installed).

This fix ensures that RequestsBackend isn't loaded when using Pusher
with Google App Engine (where it doesn't load).
zimbatm added a commit that referenced this pull request Jun 18, 2015
@zimbatm zimbatm merged commit 845e8a0 into pusher:master Jun 18, 2015
@zimbatm
Copy link
Contributor

zimbatm commented Jun 18, 2015

Thanks, makes sense

@martynsmith martynsmith deleted the gae-backend-fix branch June 22, 2015 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants