Skip to content

Commit

Permalink
Fixed unicode and escape string issues with key_names and properly re…
Browse files Browse the repository at this point in the history
…ference InternalError as db.InternalError
  • Loading branch information
gumptionthomas committed Jan 7, 2009
1 parent 5f086b8 commit 98415f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions views.py
Expand Up @@ -685,7 +685,7 @@ def backup_rows(request):
reference_fields_code = reference_fields_code[:-2]

# OK, all properties are ready, write out the row's constructor to create the row.
code += u'\t%s = %s(key_name="%s"%s%s%s)\n' % (row_name, current_model, key_name, properties_code, reference_fields_code, parent_code)
code += u'\t%s = %s(key_name=%s%s%s%s)\n' % (row_name, current_model, key_name.__repr__(), properties_code, reference_fields_code, parent_code)

# Does this row belong to an Expando model? (It's OK to put Expoando properties after the
# constructor as they cannot be required.)
Expand Down Expand Up @@ -715,7 +715,7 @@ def backup_rows(request):

try:
code_shard.put()
except InternalError:
except db.InternalError:
logging.warning('InternalError detected. on code_shard put. Trying twice more.')
# Try twice more to see if the datastore error goes away.
success = False
Expand All @@ -724,7 +724,7 @@ def backup_rows(request):
code_shard.put()
success = True
break
except InternalError:
except db.InternalError:
logging.warning('InternalError on code_shard put attempt ' + str(tries+1))
if not success:
logging.error('InternalError: could not put code_shard.')
Expand Down

0 comments on commit 98415f1

Please sign in to comment.