Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for unicode_decode_error_handler BSON codec options #915

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

quirin-pauli
Copy link

We faced the following issue:
bson.errors.InvalidBSON: 'utf-8' codec can't decode bytes in position 314-315: invalid continuation byte

This pull request adds support to pymongo's BSON codec option to overwrite the default `unicode_decode_error_handler=strict'

@howardkhl
Copy link

@quirin-pauli I made the changes to connector.py, set "unicodeDecode": "ignore" in config.json. However still encounters bson.errors.InvalidBSON

@quirin-pauli
Copy link
Author

@howardkhl this only ignores failures while decoding Unicode characters.

I just saw #882 where the InvalidBSON exception is raised but for another reason:
bson.errors.InvalidBSON: year 46312 is out of range

This pull request won't solve this issue and it looks like there's no easy solution to this problem.

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