asolfre / appengine-rest-server

Automatically exported from code.google.com/p/appengine-rest-server
Other
0 stars 0 forks source link

Setting caching = True causes AttributeError: 'Response' object has no attribute 'getvalue' #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Change caching = False to caching =True (line 1825 in __init__.py)
2.
3.

What is the expected output? What do you see instead?
Expected:
REST server output with values cached for faster retrieval on subsequent calls

Actual results:
'Response' object has no attribute 'getvalue'
Traceback (most recent call last):
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/apps/s~testgbbluenote/2-7.360044231143261105/libs/rest/__init__.py", line 2574, in handle_exception
    super(Dispatcher, self).handle_exception(exception, debug_mode)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~testgbbluenote/2-7.360044231143261105/libs/rest/__init__.py", line 1987, in get
    CachedResponse(self.response.out.getvalue(),
AttributeError: 'Response' object has no attribute 'getvalue'

Traceback (most recent call last):
  File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 193, in Handle
    result = handler(dict(self._environ), self._StartResponse)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1519, in __call__
    response = self._internal_error(e)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/apps/s~testgbbluenote/2-7.360044231143261105/libs/rest/__init__.py", line 2574, in handle_exception
    super(Dispatcher, self).handle_exception(exception, debug_mode)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~testgbbluenote/2-7.360044231143261105/libs/rest/__init__.py", line 1987, in get
    CachedResponse(self.response.out.getvalue(),
AttributeError: 'Response' object has no attribute 'getvalue'

What version of the product are you using? On what operating system?
using latest version (1.0.6) with Google App Engine/Python 2.7

Please provide any additional information below.

Original issue reported on code.google.com by jeremcal...@gmail.com on 2 Jul 2012 at 11:25

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r108.

I checked a change into the trunk which should fix this issue, however i do not 
have an environment where i can test the fix.  Please let me know if this 
change fixes the issue for you.

Original comment by jahlborn@gmail.com on 6 Jul 2012 at 4:04

GoogleCodeExporter commented 9 years ago

Original comment by jahlborn@gmail.com on 6 Jul 2012 at 4:29

GoogleCodeExporter commented 9 years ago
The changes worked.
Thanks!

Original comment by jeremcal...@gmail.com on 6 Jul 2012 at 5:50

GoogleCodeExporter commented 9 years ago
excellent!

Original comment by jahlborn@gmail.com on 6 Jul 2012 at 11:48