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

PyMongo 2.3 for Python2.4 raises "“bad format Char" exception for Safe Inserts

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.3
    • Component/s: None
    • Environment:
      MongoDB 2.2.0
      Python 2.4

      When using the safe=True inserts to the collection, it raises an error which we have the stack trace bellow.

      It inserts with no error for the inserts with safe = False

      My guess is the response from MongoDB itself, which the river is not abale to parse.

      This completely works fine on Python 2.7 though. This is a version specific issue for Python2.4.

      Here is the stack trace for this :

              MongoDB['my_collection'].save({'test' : 1111111} , safe = True)
            File "D:\Python24\Lib\site-packages\pymongo\collection.py", line 241, in save
              return self.insert(to_save, manipulate, safe, check_keys, **kwargs)
            File "D:\Python24\Lib\site-packages\pymongo\collection.py", line 315, in insert
              continue_on_error, self.__uuid_subtype), safe)
            File "D:\Python24\Lib\site-packages\pymongo\connection.py", line 831, in _send_message
              rv = self.__check_response_to_last_error(response)
            File "D:\Python24\Lib\site-packages\pymongo\connection.py", line 753, in __check_response_to_last_error
              response = helpers._unpack_response(response)
            File "D:\python24\lib\site-packages\pymongo\helpers.py", line 111, in _unpack_response
              as_class, tz_aware, uuid_subtype)
          SystemError: bad format char passed to Py_BuildValue
      

        1. helpers.py
          8 kB
          A. Jesse Jiryu Davis
        2. helpers.py
          7 kB
          MajiD Fatemian
        3. Mongo_Issue.py
          0.7 kB
          MajiD Fatemian
        4. mongo_safe_response.bin
          0.2 kB
          MajiD Fatemian

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            majidfn MajiD Fatemian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: