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

Fixed wrong Python object name for UTC in C module #233

Closed
wants to merge 2 commits into from

Conversation

girogiro
Copy link
Contributor

Python object name for UTC is lowercase 'utc'. The bug sometimes results in error: bson.errors.InvalidBSON: 'module' object has no attribute 'UTC' when reading from the database.

@behackett
Copy link
Member

Thanks for reporting this. I'm surprised no one has ever hit this before.

@behackett
Copy link
Member

I see where this crept in. This is a new problem in PyMongo 2.7. Thanks again for reporting it and providing a patch.

@girogiro - Are you using mod_wsgi? If so, you should read the docs for using PyMongo and mod_wsgi:

http://api.mongodb.org/python/current/examples/mod_wsgi.html#pymongo-and-mod-wsgi

This exception should only happen if the code is running in a python sub-interpreter.

@behackett
Copy link
Member

Merged to the v2.7 and 3.0-dev branches. Thanks again for the report and patch. I've opened a ticket to track the issue here:

https://jira.mongodb.org/browse/PYTHON-695

@behackett behackett closed this May 1, 2014
@girogiro
Copy link
Contributor Author

@behackett Yes, I am using mod_wsgi. I took me hours to find the problem, searching first in Eve REST API framework I am working with, then in Flask microframework it is based on, then in PyMongo and finally in its C-extensions while checking for errors in Apache log.

Thanks for the advice. I've modified the Apache conf according to the referenced guidelines.

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