Adapt pyax for use in Google AppEngine

Bug #217961 reported by Kevin Shuk on 2008-04-15
4
Affects Status Importance Assigned to Milestone
pyax
Wishlist
Unassigned

Bug Description

Since pyax is pure python, it should be able to run in Google's AppEngine save for one detail: opening sockets is not allowed. Google provides the URL fetch service, however, and all connections should be routable over URL fetch in order to make this work!

Sam Johnston (samj) wrote :

I was about to report the same issue. Although I haven't looked at the code, a version that worked for App Engine should also work for standard interpreters. Presumably the offending calls are centralised.

Kevin Shuk (surf) wrote :

Importance raised to high as there seems to be community interest in this feature as well.

Changed in pyax:
importance: Undecided → High
status: New → Confirmed
Kevin Shuk (surf) wrote :

I believe that the only calls that needs modification for GAE are the urllib2 methods used in the post method of the SoapEnvelope class of the beatbox module.

This is, of course, from a) knowing that all pyax calls are made from this point and b) not knowing what's involved in wrapping or converting this to GAE's URL fetch service.

Presumably, there may need to be a switch in the Context object to change how the call is made based on whether pyax is operating within GAE or not.

Kevin Shuk (surf) on 2008-09-30
Changed in pyax:
importance: High → Wishlist
Anthony Lenton (elachuni) wrote :

I've got a small Google App Engine using pyax running on http://achuni-pyax.appspot.com/

As Kevin pointed out it was just a matter of giving urllib2 a handler that doesn't rely on sockets by using Google's urlfetch instead. (And commenting out a unused import of os.fstat in cache.py).

I believe that this same fix could be applied to other libs that need a working HTTPS handler on Google App Engine, so I separated it out in to its own file.

(for if you don't trust your user and password to the running webapp, I've added the code for the webapp to the tests/ directory in lp:~elachuni/+junk/pyax-appengine)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers