Ticket #313 (closed defect: fixed)

Opened 3 months ago

Last modified 2 months ago

TypeError when returning a tuple using TwistedGateway

Reported by: jacintos Owned by: nick
Priority: major Milestone: 0.4
Component: Gateway Version: 0.3.1
Keywords: Cc:

Description

This is the relevant part of the stack trace I get:

2008-06-18 06:37:32-0400 [-] --- <exception caught here> ---
2008-06-18 06:37:32-0400 [-]   File "/usr/local/py-sandbox/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-linux-i686.egg/twisted/internet/defer.py", line 328, in _runCallbacks
2008-06-18 06:37:32-0400 [-]     self.result = callback(self.result, *args, **kw)
2008-06-18 06:37:32-0400 [-]   File "/usr/local/src/pyamf/pyamf/remoting/gateway/twisted.py", line 71, in response_cb
2008-06-18 06:37:32-0400 [-]     self.gateway.logger.debug("AMF Response: %r" % result)
2008-06-18 06:37:32-0400 [-] exceptions.TypeError: not all arguments converted during string formatting

I am using PyAMF r1433. Same problem with the 0.3.1 release.

An example Twisted service is attached.

Attachments

test.tac (494 bytes) - added by jacintos 3 months ago.
pyamf-response-repr-313.diff (0.6 kB) - added by nick 3 months ago.
test-313.py (230 bytes) - added by thijs 3 months ago.
test client with logging enabled

Change History

Changed 3 months ago by jacintos

Changed 3 months ago by nick

Changed 3 months ago by nick

  • owner changed from nick to jacintos
  • status changed from new to assigned

Silly error, attached patch should fix the issue.

The service should run now ..

Changed 3 months ago by thijs

test client with logging enabled

Changed 3 months ago by thijs

  • owner changed from jacintos to nick
  • milestone changed from 0.4 to 0.3.2

Tested with patch and this test client that returned:

DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:adding request Hello.sayHello()
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:executing single request
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:sending POST request to /
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:waiting for response ...
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:got response status=200
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:read 45 bytes for the response
DEBUG:pyamf.remoting.client.RemotingService.0xe57bf0:response = <Envelope amfVersion=0 clientType=0>
 (u'/1', <Response status=/onResult>[u'Hi', u'mom']</Response>)
</Envelope>
[u'Hi', u'mom']

Assigning back to Nick.

Changed 2 months ago by thijs

  • keywords review added

Changed 2 months ago by nick

Changed 2 months ago by nick

  • owner changed from nick to thijs

This branch is now ready for review. Reassigning to Thijs

Changed 2 months ago by thijs

  • keywords review removed
  • owner changed from thijs to nick

Tested the branch with the client and ran the unit tests, looks good to me:

DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Adding request Hello.sayHello()
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Executing single request: /1
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:AMF version: 0
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Client type: 0
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Sending POST request to /
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Waiting for response...
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Got response status = 200
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Content-Type = application/x-amf
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Content-Length = 45
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Read 45 bytes for the response
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Response = <Envelope amfVersion=0 clientType=0>
 (u'/1', <Response status=/onResult>[u'Hi', u'mom']</Response>)
</Envelope>
DEBUG:pyamf.remoting.client.RemotingService.0xd57830:Removing request: /1
[u'Hi', u'mom']

Changed 2 months ago by nick

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r1500.

Note: See TracTickets for help on using tickets.