1. Ludia
  2. Untitled project
  3. dynamodb-mock
  4. Pull requests

Pull requests

#9 Open
Repository
pedantic_git
Branch
default
Repository
Ludia
Branch
default

hash_key and range_key can be utf8, so make sure the format strings are unicode to avoid UnicodeEncodeError

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 
hg pull -r default https://bitbucket.org/pedantic_git/dynamodb-mock
Author
  1. pedantic_git
Reviewers
Description

Operations such as GetItem fail if the hash_key or range_key contains non-ascii utf8 characters.

The error looks something like this:

UnicodeEncodeError: ('ascii', u'test-utf8-username-extended-richd-perl_\u2603snowman\u2603', 39, 40, 'ordinal not in range(128)')

The error does not occur with real Amazon DynamoDB so it is probably a bug.

This pull request makes sure that all calls to string.format where hash_key/range_key are interpolated instead use unicode.format.

I have tested it extensively with the memory backend but not with other backends.

Comments (0)