Ticket #492 (closed defect: fixed)

Opened 12 months ago

Last modified 11 months ago

In GAE request using python client

Reported by: webysther Owned by: nick
Priority: critical Milestone: 0.4.2
Component: Client Version: 0.4.1
Keywords: client, http, content-length Cc:
Fixed in revision: 2283 Branch: client-content-length-492
Author: nick

Description (last modified by thijs) (diff)

unsupported operand type(s) for +: 'int' and 'str'

Traceback (most recent call last):
  File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 501, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/webservice-credential-hom/2.331952975332179148/service.py", line 209, in get
    token = service.loginUser( user )
  File "/base/data/home/apps/webservice-credential-hom/2.331952975332179148/pyamf/remoting/client/__init__.py", line 52, in __call__
    return self.service._call(self, *args)
  File "/base/data/home/apps/webservice-credential-hom/2.331952975332179148/pyamf/remoting/client/__init__.py", line 101, in _call
    response = self._gw.execute_single(request)
  File "/base/data/home/apps/webservice-credential-hom/2.331952975332179148/pyamf/remoting/client/__init__.py", line 409, in execute_single
    envelope = self._getResponse()
  File "/base/data/home/apps/webservice-credential-hom/2.331952975332179148/pyamf/remoting/client/__init__.py", line 475, in _getResponse
    bytes = http_response.read(content_length)
  File "/base/python_dist/lib/python2.5/StringIO.py", line 134, in read
    newpos = min(self.pos+n, self.len)
TypeError: unsupported operand type(s) for +: 'int' and 'str'

I solved by doing the following:

Line 475 replace:

try:
  bytes = http_response.read(content_length)
except:
  bytes = http_response.read()

Attachments

__init__.py Download (15.9 KB) - added by webysther 12 months ago.

Change History

Changed 12 months ago by webysther

Changed 12 months ago by thijs

  • priority changed from blocker to critical
  • description modified (diff)
  • milestone changed from At some point to 0.5

Changed 11 months ago by nick

  • status changed from new to accepted

Changed 11 months ago by nick

  • keywords client, http, content-length, review added
  • owner nick deleted
  • status changed from accepted to assigned
  • branch set to client-content-length-492
  • author set to nick

If an empty Content-Length header is received then the whole body will be read, if a non integer is read then a ValueError is raised

Changed 11 months ago by thijs

  • keywords content-length added; content-length, review removed
  • owner set to nick

Looks good to me, please merge.

Changed 11 months ago by nick

  • status changed from assigned to closed
  • revfixed set to 2283
  • resolution set to fixed
Note: See TracTickets for help on using tickets.