Commit 8a43b8e
committed
Workaround for test.test_ssl.ThreadedTests.test_wrong_cert_tls*
Failure:
2026-06-01T20:33:22.6137502Z ======================================================================
2026-06-01T20:33:22.6138687Z FAIL: test_wrong_cert_tls13 (test.test_ssl.ThreadedTests.test_wrong_cert_tls13)
2026-06-01T20:33:22.6139079Z ----------------------------------------------------------------------
2026-06-01T20:33:22.6139922Z ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine. (os error 10053)
2026-06-01T20:33:22.6140076Z
2026-06-01T20:33:22.6140508Z During handling of the above exception, another exception occurred:
2026-06-01T20:33:22.6140757Z
2026-06-01T20:33:22.6141051Z Traceback (most recent call last):
2026-06-01T20:33:22.6141607Z File "D:\a\RustPython\RustPython\Lib\test\test_ssl.py", line 238, in wrapper
2026-06-01T20:33:22.6141895Z return func(*args, **kw)
2026-06-01T20:33:22.6142621Z File "D:\a\RustPython\RustPython\Lib\test\test_ssl.py", line 3267, in test_wrong_cert_tls13
2026-06-01T20:33:22.6142922Z with self.assertRaisesRegex(
2026-06-01T20:33:22.6143512Z ~~~~~~~~~~~~~~~~~~~~~~^
2026-06-01T20:33:22.6143779Z OSError,
2026-06-01T20:33:22.6144033Z ^^^^^^^^
2026-06-01T20:33:22.6144283Z ...<2 lines>...
2026-06-01T20:33:22.6144550Z 'Broken pipe'
2026-06-01T20:33:22.6144813Z ^^^^^^^^^^^^^
2026-06-01T20:33:22.6145053Z ):
2026-06-01T20:33:22.6145328Z ^
2026-06-01T20:33:22.6146900Z AssertionError: "alert unknown ca|EOF occurred|TLSV1_ALERT_UNKNOWN_CA|closed by the remote host|Connection reset by peer|Broken pipe" does not match "[WinError 10053] An established connection was aborted by the software in your host machine. (os error 10053)"
There are two problems here:
1) WSAECONNABORTED is reported by some socket operation but test case
checks only for stringified WSAECONNRESET. Both test_wrong_cert_tls*
tests check for various kinds of connection-related errors so I
suppose that those tests are problematic even in cpython (there are
comments about this too).
2) RustPython produces wrong strings for OSError.
cpython has a separate mapping for this: https://github.com/python/cpython/blob/5607950ef232dad16d75c0cf53101d9649d89115/Modules/errnomodule.c1 parent 21a68f2 commit 8a43b8e
1 file changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
2948 | 2950 | | |
2949 | 2951 | | |
2950 | 2952 | | |
2951 | | - | |
2952 | | - | |
2953 | | - | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
2954 | 2981 | | |
2955 | 2982 | | |
2956 | 2983 | | |
| |||
0 commit comments