Ticket #510 (closed defect: fixed)
encoding error with dictionary keys pointing to the same object
| Reported by: | aball | Owned by: | nick |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.4.2 |
| Component: | Remoting | Version: | 0.4.1 |
| Keywords: | Cc: | ||
| Fixed in revision: | 2284 | Branch: | remoting-encode-510 |
| Author: | nick |
Description
I've noticed what looks like an encoding error when I make requests like the following:
address = {'street_1' : '221B Baker Street', 'city' : 'London',
'country' : 'UK'}
print svc.demonstrate_issue({'groups' : [1], 'shipping_address' : address,
'billing_address' : address})
The 'shipping_address' and 'billing_address' elements in the dictionary should be received as pointing to the same dictionary on the server side. However, I see either 'shipping_address' or 'billing_address' pointing to the same element that 'groups' does, which is a list in this case.
I'm using Django 1.0.2 with PyAMF's Django gateway as the server. I'm attaching a small Django project and sample client that demonstrates the issue. After downloading and extracting the attachment, here's all you need to do to reproduce the issue:
aball@ws36:~/devel/PyAMF_encoding_issue$ cd pyamf_encoding_issue/ aball@ws36:~/devel/PyAMF_encoding_issue/pyamf_encoding_issue$ python manage.py runserver Validating models... 0 errors found Django version 1.0.2 final, using settings 'pyamf_encoding_issue.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. aball@ws36:~/devel/PyAMF_encoding_issue/pyamf_encoding_issue$ python manage.py runserver Validating models... 0 errors found # in a different shell aball@ws36:~/devel/PyAMF_encoding_issue$ python client.py type(param_dict['groups']) = <type 'list'> id(param_dict['groups']) = 142635884 type(param_dict['shipping_address']) = <type 'list'> id(param_dict['shipping_address']) = 142635884 type(param_dict['billing_address']) = <class 'pyamf.ASObject'> id(param_dict['billing_address']) = 140392892
Attachments
Change History
Note: See
TracTickets for help on using
tickets.



