Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-518

TypeError: unsupported type for timedelta seconds component: str

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6
    • Affects Version/s: None
    • Component/s: None
    • None

      When creating hashed indexes, throws: TypeError: unsupported type for timedelta seconds component: str

      File "build/bdist.macosx-10.4-x86_64/egg/pymongo/mongo_client.py", line 371, in _cache_index
      expire = datetime.timedelta(seconds=cache_for) + now
      TypeError: unsupported type for timedelta seconds component: str

      Someone is throwing str for cache_for here. need to check datatype.

      367 def _cache_index(self, database, collection, index, cache_for):
      368 """Add an index to the index cache for ensure_index operations.
      369 """
      370 now = datetime.datetime.utcnow()
      371 expire = datetime.timedelta(seconds=cache_for) + now

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            kennygorman Kenny Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: