[SERVER-38313] Update mongo pretty printer to be compatible with more versions of python Created: 29/Nov/18  Updated: 29/Oct/23  Resolved: 30/Nov/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.6

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to PYTHON-1696 Stop encouraging the use of BSON.deco... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2018-12-03
Participants:

 Description   

Some python (such as ones in our current toolchain) do not care for this BSONObject pretty printing code: https://github.com/mongodb/mongo/blob/d963ad9dcca8258434e955891cbeccac7aaf3ad4/buildscripts/gdb/mongo_printers.py#L124-L126

(gdb) print _request->body
$3 = unowned BSONObj 865 bytes @ 0x7f068fe3489dPython Exception <type 'exceptions.TypeError'> unbound method decode() must be called with BSON instance as first argument (got str instance instead): 



 Comments   
Comment by Githook User [ 30/Nov/18 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-38313: Update BSON decoding in GDB pretty printing.
Branch: master
https://github.com/mongodb/mongo/commit/c900b4bd14011b5e95cff597ad802a2eaa45666b

Comment by Max Hirschhorn [ 29/Nov/18 ]

This hasn't been an issue in the version of gdb we use in Evergreen because it links against Python 3 and the removal of the concept of bound methods appears to make it possible for bytes to be used in place of bson.BSON (the latter is a subclass of the former) without any issues.

(We did change the toolchain to build a version of gdb that links against Python 2 at one point, but I believe those changes have been undone.)

Generated at Thu Feb 08 04:48:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.