Opened 16 years ago
Closed 16 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 |
Description
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/serialize_partners.py", line 16, in <module>
serializer.serialize(Partner.objects.all(), stream=out)
File "/var/django/phones-lev/django/core/serializers/base.py", line 56, in serialize
return self.getvalue()
File "./django/core/serializers/pyyaml.py", line 43, in getvalue
return self.stream.getvalue()
AttributeError: 'file' object has no attribute 'getvalue'
Attachments (2)
Change History (3)
by , 16 years ago
by , 16 years ago
Attachment: | yaml-serialization-to-file.diff added |
---|
svn diff vs django r8671 which fixes the issue
comment:1 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
django\core\serializers\pyyaml.py