Opened 16 years ago

Closed 15 years ago

#8607 closed (fixed)

yaml serialization to file fails

Reported by: antony_hatchkins Owned by: nobody
Component: Core (Serialization) Version: dev
Severity: Keywords: yaml
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When serializing anything to yaml with stream=open('file','w') it fails with the following error:

XMLSerializer = serializers.get_serializer('yaml')
serializer = XMLSerializer()
serializer.serialize(Partner.objects.all(), stream=open('partners.yaml', 'w'))

Traceback (most recent call last):

File "./bin/serialization/", line 16, in <module>

serializer.serialize(Partner.objects.all(), stream=out)

File "/var/django/phones-lev/django/core/serializers/", line 56, in serialize

return self.getvalue()

File "./django/core/serializers/", line 43, in getvalue


AttributeError: 'file' object has no attribute 'getvalue'

Attachments (2) (1.9 KB ) - added by antony_hatchkins <antony.hatchkins@…> 16 years ago.
yaml-serialization-to-file.diff (531 bytes ) - added by antony_hatchkins <antony.hatchkins@…> 15 years ago.
svn diff vs django r8671 which fixes the issue

Download all attachments as: .zip

Change History (3)

by antony_hatchkins <antony.hatchkins@…>, 16 years ago

Attachment: added


by antony_hatchkins <antony.hatchkins@…>, 15 years ago

svn diff vs django r8671 which fixes the issue

comment:1 by antony_hatchkins <antony.hatchkins@…>, 15 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top