diff --git a/django/core/files/storage.py b/django/core/files/storage.py
index bf30a78..3fb2a2f 100644
--- a/django/core/files/storage.py
+++ b/django/core/files/storage.py
@@ -1,6 +1,7 @@
 import os
 import errno
 import urlparse
+import itertools
 
 from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
@@ -63,15 +64,20 @@ class Storage(object):
         Returns a filename that's free on the target storage system, and
         available for new content to be written to.
         """
-        # If the filename already exists, keep adding an underscore to the name
-        # of the file until the filename doesn't exist.
-        while self.exists(name):
+        # If the filename already exists, add a number to the filename
+        # until an available name is found.
+        if self.exists(name):
+            # Build a filename template out of the (existing) name
             try:
                 dot_index = name.rindex('.')
             except ValueError: # filename has no dot
-                name += '_'
+                template = "%s_%%d" % (name,)
             else:
-                name = name[:dot_index] + '_' + name[dot_index:]
+                template = "%s_%%d%s" % (name[:dot_index], name[dot_index:],)
+            # Iterate indefinitely until a filename is found.
+            count = itertools.count(1)
+            while self.exists(name):
+                name = template % count.next()
         return name
 
     def path(self, name):
diff --git a/tests/modeltests/files/models.py b/tests/modeltests/files/models.py
index ba3eb99..182eab7 100644
--- a/tests/modeltests/files/models.py
+++ b/tests/modeltests/files/models.py
@@ -93,7 +93,7 @@ ValueError: The 'normal' attribute has no file associated with it.
 >>> obj2 = Storage()
 >>> obj2.normal.save('django_test.txt', ContentFile('more content'))
 >>> obj2.normal
-<FieldFile: tests/django_test_.txt>
+<FieldFile: tests/django_test_1.txt>
 >>> obj2.normal.size
 12
 
@@ -102,7 +102,7 @@ ValueError: The 'normal' attribute has no file associated with it.
 >>> cache.set('obj1', obj1)
 >>> cache.set('obj2', obj2)
 >>> cache.get('obj2').normal
-<FieldFile: tests/django_test_.txt>
+<FieldFile: tests/django_test_1.txt>
 
 # Deleting an object deletes the file it uses, if there are no other objects
 # still using that file.
@@ -110,7 +110,7 @@ ValueError: The 'normal' attribute has no file associated with it.
 >>> obj2.delete()
 >>> obj2.normal.save('django_test.txt', ContentFile('more content'))
 >>> obj2.normal
-<FieldFile: tests/django_test_.txt>
+<FieldFile: tests/django_test_1.txt>
 
 # Default values allow an object to access a single file.
 
diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py
index 6b219f0..bb1f3eb 100644
--- a/tests/regressiontests/file_storage/tests.py
+++ b/tests/regressiontests/file_storage/tests.py
@@ -121,9 +121,9 @@ class FileSaveRaceConditionTest(TestCase):
         name = self.save_file('conflict')
         self.thread.join()
         self.assert_(self.storage.exists('conflict'))
-        self.assert_(self.storage.exists('conflict_'))
+        self.assert_(self.storage.exists('conflict_1'))
         self.storage.delete('conflict')
-        self.storage.delete('conflict_')
+        self.storage.delete('conflict_1')
 
 class FileStoragePermissions(TestCase):
     def setUp(self):
