Skip to content

Fixed OverflowError when returning job IDs - #110

Merged
sylvinus merged 2 commits into
pricingassistant:masterfrom
FlorianPerucki:master
Jan 6, 2016
Merged

Fixed OverflowError when returning job IDs#110
sylvinus merged 2 commits into
pricingassistant:masterfrom
FlorianPerucki:master

Conversation

@FlorianPerucki

Copy link
Copy Markdown
Contributor

Some ObjectId objects may lead to an OverflowError when dumped using usjon.dumps() :

>>> ujson.dumps(ObjectId("568cf86d7bd78100822b9b2e"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Unsupported UTF-8 sequence length when encoding string

@sylvinus

sylvinus commented Jan 6, 2016

Copy link
Copy Markdown
Contributor

Good catch! However output should stay JSON-encoded. You should use this instead:
https://github.com/pricingassistant/mrq/blob/master/mrq/worker.py#L346

@FlorianPerucki

Copy link
Copy Markdown
Contributor Author

Nice, thanks!

sylvinus added a commit that referenced this pull request Jan 6, 2016
Fixed OverflowError when returning job IDs
@sylvinus
sylvinus merged commit 5c45163 into pricingassistant:master Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants