Fix dnspython typechecking failures

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Done
    • Priority: Unknown
    • 4.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      dnspython released a new version over the weekend that broke our typechecking: https://pypi.org/project/dnspython/2.7.0/.

      cmd [1] | mypy --install-types --non-interactive bson gridfs tools pymongo
      pymongo/srv_resolver.py:102: error: "Rdata" has no attribute "strings"  [attr-defined]
                  return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8")
                                              ^~~~~~~~~~~
      pymongo/srv_resolver.py:124: error: "Rdata" has no attribute "target"  [attr-defined]
                      (maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) for res in results
                                    ^~~~~~~~~~
      pymongo/srv_resolver.py:124: error: "Rdata" has no attribute "port"  [attr-defined]
                      (maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) for res in results
                                                                              ^~~~~~~~
      Found 3 errors in 1 file (checked 140 source files)
      

      We need to update our code to reflect this new version.

      One complication is that the new version now supports 3.9 as the oldest Python version, dropping support for 3.8.

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: