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

AssertionError: Result batch started from X, expected Y

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

      When running in optimized mode, "assert" statements are removed.
      https://www.safaribooksonline.com/library/view/learning-python-5th/9781449355722/ch34s05.html

      So their usage should be fine in tests, but not in the main pymongo driver, which may or may not be used in optimized mode.

      I'm running into some error conditions during heavy load, and I want them to throw an exception in optimized mode too, like this one:
      https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/cursor.py#L945

      So for least surprise and reproducibility, I think they should be converted to proper, named Python exceptions.

      Thanks!

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            sylvinus Sylvain Zimmer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: