Code

Ticket #8607: yaml-serialization-to-file.diff

File yaml-serialization-to-file.diff, 531 bytes (added by antony_hatchkins <antony.hatchkins@…>, 6 years ago)

svn diff vs django r8671 which fixes the issue

Line 
1Index: django/core/serializers/pyyaml.py
2===================================================================
3--- django/core/serializers/pyyaml.py   (revision 8671)
4+++ django/core/serializers/pyyaml.py   (working copy)
5@@ -36,7 +36,8 @@
6         yaml.safe_dump(self.objects, self.stream, **self.options)
7 
8     def getvalue(self):
9-        return self.stream.getvalue()
10+        if callable(getattr(self.stream, 'getvalue', None)):
11+            return self.stream.getvalue()
12 
13 def Deserializer(stream_or_string, **options):
14     """