Skip to content

Commit 5b0862e

Browse files
authored
PYTHON-5297 - AsyncMongoClient connection error causes UnboundLocalError (#2273)
1 parent 86e221e commit 5b0862e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

doc/changelog.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
Changelog
22
=========
33

4+
45
Changes in Version 4.12.1 (XXXX/XX/XX)
56
--------------------------------------
67

78
Version 4.12.1 is a bug fix release.
89

10+
- Fixed a bug that could raise ``UnboundLocalError`` when creating asynchronous connections over SSL.
911
- Fixed a bug causing SRV hostname validation to fail when resolver and resolved hostnames are identical with three domain levels.
1012

1113
Issues Resolved
1214
...............
1315

14-
See the `PyMongo 4.12 release notes in JIRA`_ for the list of resolved issues
16+
See the `PyMongo 4.12.1 release notes in JIRA`_ for the list of resolved issues
1517
in this release.
1618

17-
.. _PyMongo 4.12 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=41916
18-
.. _PYTHON-5288: https://jira.mongodb.org/browse/PYTHON-5288
19+
.. _PyMongo 4.12.1 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=43094
1920

2021
Changes in Version 4.12.0 (2025/04/08)
2122
--------------------------------------

pymongo/pool_shared.py

-2
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,10 @@ async def _configured_protocol_interface(
346346
ssl=ssl_context,
347347
)
348348
except _CertificateError:
349-
transport.abort()
350349
# Raise _CertificateError directly like we do after match_hostname
351350
# below.
352351
raise
353352
except (OSError, SSLError) as exc:
354-
transport.abort()
355353
# We raise AutoReconnect for transient and permanent SSL handshake
356354
# failures alike. Permanent handshake failures, like protocol
357355
# mismatch, will be turned into ServerSelectionTimeoutErrors later.

0 commit comments

Comments
 (0)