Skip to content

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

Closed
girogiro wants to merge 2 commits into
mongodb:masterfrom
girogiro:master
Closed

girogiro wants to merge 2 commits into
mongodb:masterfrom
girogiro:master

Conversation

@girogiro

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@behackett

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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