Index: django/core/serializers/json.py
===================================================================
--- django/core/serializers/json.py	(Revision 7020)
+++ django/core/serializers/json.py	(Arbeitskopie)
@@ -4,7 +4,6 @@
 
 import datetime
 from django.utils import simplejson
-from django.utils.simplejson import decoder
 from django.core.serializers.python import Serializer as PythonSerializer
 from django.core.serializers.python import Deserializer as PythonDeserializer
 try:
@@ -22,12 +21,34 @@
     """
     internal_use_only = False
     
+    def start_serialization(self):
+        self._current = None
+        self.json_kwargs = self.options.copy()
+        self.json_kwargs.pop('stream', None)
+        self.json_kwargs.pop('fields', None)
+        self.stream.write("[")
+
     def end_serialization(self):
-        self.options.pop('stream', None)
-        self.options.pop('fields', None)
-        simplejson.dump(self.objects, self.stream, cls=DjangoJSONEncoder, **self.options)
+        if self.options.get("indent"):
+            self.stream.write("\n")
+        self.stream.write("]")
+        if self.options.get("indent"):
+            self.stream.write("\n")
 
+    def end_object(self, obj):
+        # self._current has the field data
+        if not self.first:
+            self.stream.write(",")
+            if not self.options.get("indent"):
+                self.stream.write(" ")
+        if self.options.get("indent"):
+            self.stream.write("\n")
+        simplejson.dump(self.get_dump_object(obj), self.stream,
+                        cls=DjangoJSONEncoder, **self.json_kwargs)
+        self._current = None
+
     def getvalue(self):
+        # overwrite PythonSerializer.getvalue() with base Serializer.getvalue()
         if callable(getattr(self.stream, 'getvalue', None)):
             return self.stream.getvalue()
 
Index: django/core/serializers/base.py
===================================================================
--- django/core/serializers/base.py	(Revision 7020)
+++ django/core/serializers/base.py	(Arbeitskopie)
@@ -36,6 +36,7 @@
         self.selected_fields = options.get("fields")
 
         self.start_serialization()
+        self.first = True
         for obj in queryset:
             self.start_object(obj)
             for field in obj._meta.fields:
@@ -51,6 +52,8 @@
                     if self.selected_fields is None or field.attname in self.selected_fields:
                         self.handle_m2m_field(obj, field)
             self.end_object(obj)
+            if self.first:
+                self.first = False
         self.end_serialization()
         return self.getvalue()
 
@@ -59,7 +62,11 @@
         Convert a field's value to a string.
         """
         if isinstance(field, models.DateTimeField):
-            value = getattr(obj, field.name).strftime("%Y-%m-%d %H:%M:%S")
+            value = getattr(obj, field.name)
+            if value is None:
+                value = ""
+            else:
+                value = value.strftime("%Y-%m-%d %H:%M:%S")
         elif isinstance(field, models.FileField):
             value = getattr(obj, "get_%s_url" % field.name, lambda: None)()
         else:
Index: django/core/serializers/python.py
===================================================================
--- django/core/serializers/python.py	(Revision 7020)
+++ django/core/serializers/python.py	(Arbeitskopie)
@@ -27,15 +27,19 @@
         self._current = {}
 
     def end_object(self, obj):
-        self.objects.append({
+        self.objects.append(self.get_dump_object(obj))
+        self._current = None
+
+    def get_dump_object (self, obj):
+        return {
             "model"  : smart_unicode(obj._meta),
             "pk"     : smart_unicode(obj._get_pk_val(), strings_only=True),
             "fields" : self._current
-        })
-        self._current = None
+        }
 
     def handle_field(self, obj, field):
-        self._current[field.name] = smart_unicode(getattr(obj, field.name), strings_only=True)
+        value = smart_unicode(getattr(obj, field.name), strings_only=True)
+        self._current[field.name] = value
 
     def handle_fk_field(self, obj, field):
         related = getattr(obj, field.name)
Index: django/core/management/commands/dumpdata.py
===================================================================
--- django/core/management/commands/dumpdata.py	(Revision 7020)
+++ django/core/management/commands/dumpdata.py	(Arbeitskopie)
@@ -2,6 +2,7 @@
 from django.core import serializers
 
 from optparse import make_option
+import sys
 
 class Command(BaseCommand):
     option_list = BaseCommand.option_list + (
@@ -35,12 +36,13 @@
         except KeyError:
             raise CommandError("Unknown serialization format: %s" % format)
 
-        objects = []
-        for app in app_list:
-            for model in get_models(app):
-                objects.extend(model._default_manager.all())
+        def get_objects ():
+            for app in app_list:
+                for model in get_models(app):
+                    for obj in model._default_manager.order_by(model._meta.pk.attname).iterator():
+                        yield obj
         try:
-            return serializers.serialize(format, objects, indent=indent)
+            serializers.serialize(format, get_objects(), indent=indent, stream=sys.stdout)
         except Exception, e:
             if show_traceback:
                 raise
Index: tests/modeltests/fixtures/models.py
===================================================================
--- tests/modeltests/fixtures/models.py	(Revision 7020)
+++ tests/modeltests/fixtures/models.py	(Arbeitskopie)
@@ -81,7 +81,7 @@
 
 # Dump the current contents of the database as a JSON fixture
 >>> management.call_command('dumpdata', 'fixtures', format='json')
-[{"pk": 3, "model": "fixtures.article", "fields": {"headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00"}}, {"pk": 2, "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", "pub_date": "2006-06-16 12:00:00"}}, {"pk": 1, "model": "fixtures.article", "fields": {"headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00"}}]
+[{"pk": 1, "model": "fixtures.article", "fields": {"headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00"}}, {"pk": 2, "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", "pub_date": "2006-06-16 12:00:00"}}, {"pk": 3, "model": "fixtures.article", "fields": {"headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00"}}]
 """
 
 from django.test import TestCase
