HypeTutorials / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Check to see whether filesystem write possible change in Python 2.7 #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Version downloaded: google-api-python-client-1.0beta7

What steps will reproduce the problem?
1. Download the basic example to a GAE production application (taken from 
http://code.google.com/p/google-api-python-client/source/browse/#hg%2Fsamples%2F
appengine)
2. Set runtime to by python27 in app.yaml
3. Upload to prod GAE
4. App fails to load because the filesystem write check in 2.7 succeeds where 
it failed in 2.5 (this maybe a GAE problem??) - this is line 61 of 
oauth2client.client in my version, specifically the check if hasattr(os, 
'tempnam'). This check succeeds under 2.7 but then the subsequent attempted 
write (CACHED_HTTP = httplib2.Http('.cache')) fails

Confirmed this change in behaviour via my two runtime env check apps:

http://myitcv-python2-5-test.appspot.com/
http://myitcv-python2-7-test.appspot.com/

Running in dev shows a runtime of 2.7 but hasattr(os, 'tempnam') == False

Please let me know if you need more details

Original issue reported on code.google.com by p...@myitcv.org.uk on 16 Dec 2011 at 6:57

GoogleCodeExporter commented 8 years ago
Really the check as written is wrong - just because it's possible to write to 
/tmp/... doesn't necessarily mean that it's possible to write to $CWD (where 
the relative '.cache' path resolves into).

Ideally, the app should just try to create the filesystem-backed Http instance 
and catch the OSError if it fails, creating a non-filesystem-backed version in 
that case.

Original comment by amber.y...@gmail.com on 28 Jan 2012 at 11:20

GoogleCodeExporter commented 8 years ago
(And possibly in addition, allow external specification of the cache path.)

Original comment by amber.y...@gmail.com on 28 Jan 2012 at 11:21

GoogleCodeExporter commented 8 years ago
http://codereview.appspot.com/5593052/

Original comment by jcgregorio@google.com on 30 Jan 2012 at 1:30

GoogleCodeExporter commented 8 years ago
Issue 89 has been merged into this issue.

Original comment by jcgregorio@google.com on 30 Jan 2012 at 1:30

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 04ce7a114974.

Original comment by jcgregorio@google.com on 31 Jan 2012 at 12:42