Upgrade python/cpython3 to v3.8.3

Test: None
Change-Id: I29e51c5f115cc116a935c87d674e1c7ad61e53f5
diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml
index 4c2f115..9b638dd 100644
--- a/.azure-pipelines/ci.yml
+++ b/.azure-pipelines/ci.yml
@@ -35,7 +35,9 @@
 - job: macOS_CI_Tests
   displayName: macOS CI Tests
   dependsOn: Prebuild
-  condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
+  #condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
+  # bpo-39837: macOS tests on Azure Pipelines are disabled
+  condition: false
 
   variables:
     testRunTitle: '$(build.sourceBranchName)-macos'
@@ -59,7 +61,7 @@
   variables:
     testRunTitle: '$(build.sourceBranchName)-linux'
     testRunPlatform: linux
-    openssl_version: 1.1.1d
+    openssl_version: 1.1.1f
 
   steps:
   - template: ./posix-steps.yml
@@ -116,7 +118,7 @@
   variables:
     testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
     testRunPlatform: linux-coverage
-    openssl_version: 1.1.1d
+    openssl_version: 1.1.1f
 
   steps:
   - template: ./posix-steps.yml
diff --git a/.azure-pipelines/macos-steps.yml b/.azure-pipelines/macos-steps.yml
index d2ca580..fa38a0d 100644
--- a/.azure-pipelines/macos-steps.yml
+++ b/.azure-pipelines/macos-steps.yml
@@ -6,7 +6,7 @@
 - script: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-azdev
   displayName: 'Configure CPython (debug)'
 
-- script: make -s -j4
+- script: make -j4
   displayName: 'Build CPython'
 
 - script: make pythoninfo
diff --git a/.azure-pipelines/posix-steps.yml b/.azure-pipelines/posix-steps.yml
index 3ed3abd0..a63659f 100644
--- a/.azure-pipelines/posix-steps.yml
+++ b/.azure-pipelines/posix-steps.yml
@@ -20,7 +20,7 @@
 - script: ./configure --with-pydebug
   displayName: 'Configure CPython (debug)'
 
-- script: make -s -j4
+- script: make -j4
   displayName: 'Build CPython'
 
 - ${{ if eq(parameters.coverage, 'true') }}:
diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml
index 73d4f55..65f23eb 100644
--- a/.azure-pipelines/pr.yml
+++ b/.azure-pipelines/pr.yml
@@ -33,7 +33,9 @@
 - job: macOS_PR_Tests
   displayName: macOS PR Tests
   dependsOn: Prebuild
-  condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
+  #condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
+  # bpo-39837: macOS tests on Azure Pipelines are disabled
+  condition: false
 
   variables:
     testRunTitle: '$(system.pullRequest.TargetBranch)-macos'
@@ -59,7 +61,7 @@
   variables:
     testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
     testRunPlatform: linux
-    openssl_version: 1.1.1d
+    openssl_version: 1.1.1f
 
   steps:
   - template: ./posix-steps.yml
@@ -116,7 +118,7 @@
   variables:
     testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
     testRunPlatform: linux-coverage
-    openssl_version: 1.1.1d
+    openssl_version: 1.1.1f
 
   steps:
   - template: ./posix-steps.yml
diff --git a/.azure-pipelines/windows-release/stage-build.yml b/.azure-pipelines/windows-release/stage-build.yml
index 9391a91..69f3b1e 100644
--- a/.azure-pipelines/windows-release/stage-build.yml
+++ b/.azure-pipelines/windows-release/stage-build.yml
@@ -3,7 +3,7 @@
   displayName: Docs build
   pool:
     name: 'Windows Release'
-    #vmName: win2016-vs2017
+    #vmImage: windows-2019
 
   workspace:
     clean: all
@@ -45,7 +45,7 @@
   displayName: Python build
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
@@ -91,7 +91,7 @@
   condition: and(succeeded(), ne(variables['DoPGO'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
@@ -141,7 +141,7 @@
   displayName: Publish Tcl/Tk Library
 
   pool:
-    vmName: windows-latest
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-layout-embed.yml b/.azure-pipelines/windows-release/stage-layout-embed.yml
index 3306e1c..dbccdea 100644
--- a/.azure-pipelines/windows-release/stage-layout-embed.yml
+++ b/.azure-pipelines/windows-release/stage-layout-embed.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoEmbed'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-layout-full.yml b/.azure-pipelines/windows-release/stage-layout-full.yml
index 78bc1b3..8fc8da3 100644
--- a/.azure-pipelines/windows-release/stage-layout-full.yml
+++ b/.azure-pipelines/windows-release/stage-layout-full.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoLayout'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-layout-msix.yml b/.azure-pipelines/windows-release/stage-layout-msix.yml
index 60a5c9e..def4f7d 100644
--- a/.azure-pipelines/windows-release/stage-layout-msix.yml
+++ b/.azure-pipelines/windows-release/stage-layout-msix.yml
@@ -3,7 +3,7 @@
   displayName: Make MSIX layout
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-layout-nuget.yml b/.azure-pipelines/windows-release/stage-layout-nuget.yml
index 7e20f89..41cdff8 100644
--- a/.azure-pipelines/windows-release/stage-layout-nuget.yml
+++ b/.azure-pipelines/windows-release/stage-layout-nuget.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-msi.yml b/.azure-pipelines/windows-release/stage-msi.yml
index 7afc816..9b965b0 100644
--- a/.azure-pipelines/windows-release/stage-msi.yml
+++ b/.azure-pipelines/windows-release/stage-msi.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), not(variables['SigningCertificate']))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   variables:
     ReleaseUri: http://www.python.org/{arch}
diff --git a/.azure-pipelines/windows-release/stage-pack-msix.yml b/.azure-pipelines/windows-release/stage-pack-msix.yml
index f17ba96..07e343a 100644
--- a/.azure-pipelines/windows-release/stage-pack-msix.yml
+++ b/.azure-pipelines/windows-release/stage-pack-msix.yml
@@ -3,7 +3,7 @@
   displayName: Pack MSIX bundles
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-pack-nuget.yml b/.azure-pipelines/windows-release/stage-pack-nuget.yml
index 34619fc..b100364 100644
--- a/.azure-pipelines/windows-release/stage-pack-nuget.yml
+++ b/.azure-pipelines/windows-release/stage-pack-nuget.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
index b78bd49..d5edf44 100644
--- a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
+++ b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
index 8c95f1b..b4710d8 100644
--- a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
+++ b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true')))
 
   pool:
-    #vmName: win2016-vs2017
+    #vmImage: windows-2019
     name: 'Windows Release'
 
   workspace:
diff --git a/.azure-pipelines/windows-release/stage-publish-store.yml b/.azure-pipelines/windows-release/stage-publish-store.yml
index b22147b..e0512b9 100644
--- a/.azure-pipelines/windows-release/stage-publish-store.yml
+++ b/.azure-pipelines/windows-release/stage-publish-store.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoMSIX'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-sign.yml b/.azure-pipelines/windows-release/stage-sign.yml
index a0adc05..4d757ae 100644
--- a/.azure-pipelines/windows-release/stage-sign.yml
+++ b/.azure-pipelines/windows-release/stage-sign.yml
@@ -114,7 +114,7 @@
   condition: and(succeeded(), not(variables['SigningCertificate']))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   steps:
   - checkout: none
diff --git a/.azure-pipelines/windows-release/stage-test-embed.yml b/.azure-pipelines/windows-release/stage-test-embed.yml
index b331762..d99bd74 100644
--- a/.azure-pipelines/windows-release/stage-test-embed.yml
+++ b/.azure-pipelines/windows-release/stage-test-embed.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoEmbed'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-test-msi.yml b/.azure-pipelines/windows-release/stage-test-msi.yml
index 27b0c96..21e38c3 100644
--- a/.azure-pipelines/windows-release/stage-test-msi.yml
+++ b/.azure-pipelines/windows-release/stage-test-msi.yml
@@ -3,7 +3,7 @@
   displayName: Test MSI
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.azure-pipelines/windows-release/stage-test-nuget.yml b/.azure-pipelines/windows-release/stage-test-nuget.yml
index 1f8b601..94d815e 100644
--- a/.azure-pipelines/windows-release/stage-test-nuget.yml
+++ b/.azure-pipelines/windows-release/stage-test-nuget.yml
@@ -4,7 +4,7 @@
   condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
 
   pool:
-    vmName: win2016-vs2017
+    vmImage: windows-2019
 
   workspace:
     clean: all
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 16d6f0d..d3d6747 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -51,7 +51,7 @@
     - name: Configure CPython
       run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
     - name: Build CPython
-      run: make -s -j4
+      run: make -j4
     - name: Display build info
       run: make pythoninfo
     - name: Tests
@@ -61,7 +61,7 @@
     name: 'Ubuntu'
     runs-on: ubuntu-latest
     env:
-      OPENSSL_VER: 1.1.1d
+      OPENSSL_VER: 1.1.1f
     steps:
     - uses: actions/checkout@v1
     - name: Install Dependencies
@@ -78,7 +78,7 @@
     - name: Configure CPython
       run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
     - name: Build CPython
-      run: make -s -j4
+      run: make -j4
     - name: Display build info
       run: make pythoninfo
     - name: Tests
diff --git a/.github/workflows/build_msi.yml b/.github/workflows/build_msi.yml
new file mode 100644
index 0000000..e9ecf54
--- /dev/null
+++ b/.github/workflows/build_msi.yml
@@ -0,0 +1,34 @@
+name: TestsMSI
+
+on:
+  push:
+    branches:
+    - master
+    - 3.8
+    - 3.7
+    paths:
+    - 'Tools/msi/**'
+  pull_request:
+    branches:
+    - master
+    - 3.8
+    - 3.7
+    paths:
+    - 'Tools/msi/**'
+
+jobs:
+  build_win32:
+    name: 'Windows (x86) Installer'
+    runs-on: windows-latest
+    steps:
+    - uses: actions/checkout@v1
+    - name: Build CPython installer
+      run: .\Tools\msi\build.bat -x86
+
+  build_win_amd64:
+    name: 'Windows (x64) Installer'
+    runs-on: windows-latest
+    steps:
+    - uses: actions/checkout@v1
+    - name: Build CPython installer
+      run: .\Tools\msi\build.bat -x64
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index e8b47b3..e58ad4a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -23,7 +23,7 @@
     name: 'Ubuntu (Coverage)'
     runs-on: ubuntu-latest
     env:
-      OPENSSL_VER: 1.1.1d
+      OPENSSL_VER: 1.1.1f
     steps:
     - uses: actions/checkout@v1
     - name: Install Dependencies
@@ -40,7 +40,7 @@
     - name: Configure CPython
       run: ./configure --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
     - name: Build CPython
-      run: make -s -j4
+      run: make -j4
     - name: Display build info
       run: make pythoninfo
     - name: 'Coverage Preparation'
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 405b12e..c8d395c 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -23,17 +23,17 @@
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v1
-    - uses: actions/setup-python@v1
-      with:
-        python-version: '3.7'
-        architecture: 'x64'
+    - name: 'Install Dependencies'
+      run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
+    - name: 'Configure CPython'
+      run: ./configure --with-pydebug
+    - name: 'Build CPython'
+      run: make -j4
     - name: 'Install build dependencies'
-      run: python -m pip install sphinx==2.2.0 blurb python-docs-theme
+      run: make -C Doc/ PYTHON=../python venv
     - name: 'Build documentation'
-      run: |
-        cd Doc
-        make check suspicious html PYTHON=python
-    - name: Upload
+      run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest suspicious html
+    - name: 'Upload'
       uses: actions/upload-artifact@v1
       with:
         name: doc-html
diff --git a/.travis.yml b/.travis.yml
index 8954a3a..1d3eb73 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@
 
 env:
   global:
-    - OPENSSL=1.1.1d
+    - OPENSSL=1.1.1f
     - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
     - PATH="${OPENSSL_DIR}/bin:$PATH"
     - CFLAGS="-I${OPENSSL_DIR}/include"
diff --git a/Doc/Makefile b/Doc/Makefile
index f589b6e..2169f1a 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -143,7 +143,7 @@
 venv:
 	$(PYTHON) -m venv $(VENVDIR)
 	$(VENVDIR)/bin/python3 -m pip install -U pip setuptools
-	$(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb python-docs-theme
+	$(VENVDIR)/bin/python3 -m pip install -U Sphinx==1.8.2 blurb python-docs-theme
 	@echo "The venv has been created in the $(VENVDIR) directory"
 
 dist:
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index f17c63d..b7baad5 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -105,7 +105,7 @@
    Like ``s*``, but the Python object may also be ``None``, in which case the
    ``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``.
 
-``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \*, int]
+``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
    Like ``s#``, but the Python object may also be ``None``, in which case the C
    pointer is set to ``NULL``.
 
@@ -124,7 +124,7 @@
    bytes-like objects.  **This is the recommended way to accept
    binary data.**
 
-``y#`` (read-only :term:`bytes-like object`) [const char \*, int]
+``y#`` (read-only :term:`bytes-like object`) [const char \*, int or :c:type:`Py_ssize_t`]
    This variant on ``s#`` doesn't accept Unicode objects, only bytes-like
    objects.
 
@@ -155,7 +155,7 @@
       Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
       :c:func:`PyUnicode_AsWideCharString`.
 
-``u#`` (:class:`str`) [const Py_UNICODE \*, int]
+``u#`` (:class:`str`) [const Py_UNICODE \*, int or :c:type:`Py_ssize_t`]
    This variant on ``u`` stores into two C variables, the first one a pointer to a
    Unicode data buffer, the second one its length.  This variant allows
    null code points.
@@ -172,7 +172,7 @@
       Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
       :c:func:`PyUnicode_AsWideCharString`.
 
-``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int]
+``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int or :c:type:`Py_ssize_t`]
    Like ``u#``, but the Python object may also be ``None``, in which case the
    :c:type:`Py_UNICODE` pointer is set to ``NULL``.
 
@@ -213,7 +213,7 @@
    recoding them.  Instead, the implementation assumes that the byte string object uses
    the encoding passed in as parameter.
 
-``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, int \*buffer_length]
+``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, int or :c:type:`Py_ssize_t` \*buffer_length]
    This variant on ``s#`` is used for encoding Unicode into a character buffer.
    Unlike the ``es`` format, this variant allows input data which contains NUL
    characters.
@@ -244,7 +244,7 @@
    In both cases, *\*buffer_length* is set to the length of the encoded data
    without the trailing NUL byte.
 
-``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer, int \*buffer_length]
+``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer, int or :c:type:`Py_ssize_t` \*buffer_length]
    Same as ``es#`` except that byte string objects are passed through without recoding
    them. Instead, the implementation assumes that the byte string object uses the
    encoding passed in as parameter.
@@ -549,7 +549,7 @@
       Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'``
       encoding. If the C string pointer is ``NULL``, ``None`` is used.
 
-   ``s#`` (:class:`str` or ``None``) [const char \*, int]
+   ``s#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
       Convert a C string and its length to a Python :class:`str` object using ``'utf-8'``
       encoding. If the C string pointer is ``NULL``, the length is ignored and
       ``None`` is returned.
@@ -558,14 +558,14 @@
       This converts a C string to a Python :class:`bytes` object.  If the C
       string pointer is ``NULL``, ``None`` is returned.
 
-   ``y#`` (:class:`bytes`) [const char \*, int]
+   ``y#`` (:class:`bytes`) [const char \*, int or :c:type:`Py_ssize_t`]
       This converts a C string and its lengths to a Python object.  If the C
       string pointer is ``NULL``, ``None`` is returned.
 
    ``z`` (:class:`str` or ``None``) [const char \*]
       Same as ``s``.
 
-   ``z#`` (:class:`str` or ``None``) [const char \*, int]
+   ``z#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
       Same as ``s#``.
 
    ``u`` (:class:`str`) [const wchar_t \*]
@@ -573,7 +573,7 @@
       data to a Python Unicode object.  If the Unicode buffer pointer is ``NULL``,
       ``None`` is returned.
 
-   ``u#`` (:class:`str`) [const wchar_t \*, int]
+   ``u#`` (:class:`str`) [const wchar_t \*, int or :c:type:`Py_ssize_t`]
       Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python
       Unicode object.   If the Unicode buffer pointer is ``NULL``, the length is ignored
       and ``None`` is returned.
@@ -581,7 +581,7 @@
    ``U`` (:class:`str` or ``None``) [const char \*]
       Same as ``s``.
 
-   ``U#`` (:class:`str` or ``None``) [const char \*, int]
+   ``U#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
       Same as ``s#``.
 
    ``i`` (:class:`int`) [int]
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 7300c80..85a3d94 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -358,7 +358,7 @@
 .. c:function:: int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...)
 
    Function similar to :c:func:`PyErr_WarnFormat`, but *category* is
-   :exc:`ResourceWarning` and pass *source* to :func:`warnings.WarningMessage`.
+   :exc:`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`.
 
    .. versionadded:: 3.6
 
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index d08d4f9..718f40e 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -174,6 +174,39 @@
    .. versionchanged:: 3.8
       MSVC support was added.
 
+.. c:macro:: PyDoc_STRVAR(name, str)
+
+   Creates a variable with name ``name`` that can be used in docstrings.
+   If Python is built without docstrings, the value will be empty.
+
+   Use :c:macro:`PyDoc_STRVAR` for docstrings to support building
+   Python without docstrings, as specified in :pep:`7`.
+
+   Example::
+
+      PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element.");
+
+      static PyMethodDef deque_methods[] = {
+          // ...
+          {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},
+          // ...
+      }
+
+.. c:macro:: PyDoc_STR(str)
+
+   Creates a docstring for the given input string or an empty string
+   if docstrings are disabled.
+
+   Use :c:macro:`PyDoc_STR` in specifying docstrings to support
+   building Python without docstrings, as specified in :pep:`7`.
+
+   Example::
+
+      static PyMethodDef pysqlite_row_methods[] = {
+          {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS,
+              PyDoc_STR("Returns the keys of the row.")},
+          {NULL, NULL}
+      };
 
 .. _api-objects:
 
diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index 57902a9..d2b8f4c 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -153,7 +153,7 @@
    .. c:member:: const char *m_doc
 
       Docstring for the module; usually a docstring variable created with
-      :c:func:`PyDoc_STRVAR` is used.
+      :c:macro:`PyDoc_STRVAR` is used.
 
    .. c:member:: Py_ssize_t m_size
 
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index db815ae..3bdc0f5 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -128,7 +128,7 @@
    .. versionadded:: 3.3
 
 
-.. c:function:: int PyObject_GenericSetDict(PyObject *o, void *context)
+.. c:function:: int PyObject_GenericSetDict(PyObject *o, PyObject *value, void *context)
 
    A generic implementation for the setter of a ``__dict__`` descriptor. This
    implementation does not allow the dictionary to be deleted.
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index bff5abf..163f599 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -1218,7 +1218,7 @@
    The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage collector to detect
    reference cycles. A typical implementation of a :c:member:`~PyTypeObject.tp_traverse` function
    simply calls :c:func:`Py_VISIT` on each of the instance's members that are Python
-   objects.  For example, this is function :c:func:`local_traverse` from the
+   objects that the instance owns. For example, this is function :c:func:`local_traverse` from the
    :mod:`_thread` extension module::
 
       static int
@@ -1238,6 +1238,18 @@
    debugging aid you may want to visit it anyway just so the :mod:`gc` module's
    :func:`~gc.get_referents` function will include it.
 
+   .. warning::
+       When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members
+       that the instance *owns* (by having strong references to them) must be
+       visited. For instance, if an object supports weak references via the
+       :c:member:`~PyTypeObject.tp_weaklist` slot, the pointer supporting
+       the linked list (what *tp_weaklist* points to) must **not** be
+       visited as the instance does not directly own the weak references to itself
+       (the weakreference list is there to support the weak reference machinery,
+       but the instance has no strong reference to the elements inside it, as they
+       are allowed to be removed even if the instance is still alive).
+
+
    Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to
    :c:func:`local_traverse` to have these specific names; don't name them just
    anything.
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index cfed1bd..3ccc20b 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -1673,7 +1673,8 @@
 PyObject_GenericSetAttr:PyObject*:value:+1:
 
 PyObject_GenericSetDict:int:::
-PyObject_GenericSetDict:PyObject*:o:+1:
+PyObject_GenericSetDict:PyObject*:o:0:
+PyObject_GenericSetDict:PyObject*:value:+1:
 PyObject_GenericSetDict:void*:context::
 
 PyObject_GetAttr:PyObject*::+1:
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
index 5b32a2c..25dc293 100644
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -395,18 +395,26 @@
        }
 
        /* Add a built-in module, before Py_Initialize */
-       PyImport_AppendInittab("spam", PyInit_spam);
+       if (PyImport_AppendInittab("spam", PyInit_spam) == -1) {
+           fprintf(stderr, "Error: could not extend in-built modules table\n");
+           exit(1);
+       }
 
        /* Pass argv[0] to the Python interpreter */
        Py_SetProgramName(program);
 
-       /* Initialize the Python interpreter.  Required. */
+       /* Initialize the Python interpreter.  Required.
+          If this step fails, it will be a fatal error. */
        Py_Initialize();
 
        /* Optionally import the module; alternatively,
           import can be deferred until the embedded script
           imports it. */
-       PyImport_ImportModule("spam");
+       pmodule = PyImport_ImportModule("spam");
+       if (!pmodule) {
+           PyErr_Print();
+           fprintf(stderr, "Error: could not import module 'spam'\n");
+       }
 
        ...
 
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 70b11d6..6cc1b52 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -1494,8 +1494,8 @@
 
 Here the ``UpperOut`` class redefines the ``write()`` method to convert the
 argument string to uppercase before calling the underlying
-``self.__outfile.write()`` method.  All other methods are delegated to the
-underlying ``self.__outfile`` object.  The delegation is accomplished via the
+``self._outfile.write()`` method.  All other methods are delegated to the
+underlying ``self._outfile`` object.  The delegation is accomplished via the
 ``__getattr__`` method; consult :ref:`the language reference <attribute-access>`
 for more information about controlling attribute access.
 
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
index a91606c..e6d5a3e 100644
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -532,7 +532,7 @@
 
    python setup.py install --install-scripts=/usr/local/bin
 
-(This performs an installation using the "prefix scheme," where the prefix is
+(This performs an installation using the "prefix scheme", where the prefix is
 whatever your Python interpreter was installed with--- :file:`/usr/local/python`
 in this case.)
 
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 80afbbc..6ca2760 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -308,7 +308,7 @@
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Constant(value=node.id)),
                   ctx=node.ctx
-              ), node)
+              )
 
    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index a5e8d04..8dcf945 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -33,10 +33,10 @@
 :class:`UserString`     wrapper around string objects for easier string subclassing
 =====================   ====================================================================
 
-.. deprecated-removed:: 3.3 3.9
+.. deprecated-removed:: 3.3 3.10
     Moved :ref:`collections-abstract-base-classes` to the :mod:`collections.abc` module.
     For backwards compatibility, they continue to be visible in this module through
-    Python 3.8.
+    Python 3.9.
 
 
 :class:`ChainMap` objects
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 49e22fa..61d3982 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -161,7 +161,8 @@
    If a row has more fields than fieldnames, the remaining data is put in a
    list and stored with the fieldname specified by *restkey* (which defaults
    to ``None``).  If a non-blank row has fewer fields than fieldnames, the
-   missing values are filled-in with ``None``.
+   missing values are filled-in with the value of *restval* (which defaults
+   to ``None``).
 
    All other optional or keyword arguments are passed to the underlying
    :class:`reader` instance.
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index 37258d4..10edcac 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -19,6 +19,8 @@
 The member variables to use in these generated methods are defined
 using :pep:`526` type annotations.  For example this code::
 
+  from dataclasses import dataclass
+
   @dataclass
   class InventoryItem:
       '''Class for keeping track of an item in inventory.'''
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index 4e640cc..3dda35f 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -1475,9 +1475,18 @@
 
 .. data:: HAVE_THREADS
 
-   The default value is ``True``. If Python is compiled without threads, the
-   C version automatically disables the expensive thread local context
-   machinery. In this case, the value is ``False``.
+   The value is ``True``.  Deprecated, because Python now always has threads.
+
+.. deprecated:: 3.9
+
+.. data:: HAVE_CONTEXTVAR
+
+   The default value is ``True``. If Python is compiled ``--without-decimal-contextvar``,
+   the C version uses a thread-local rather than a coroutine-local context and the value
+   is ``False``.  This is slightly faster in some nested context scenarios.
+
+.. versionadded:: 3.9 backported to 3.7 and 3.8
+
 
 Rounding modes
 --------------
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index b1404af..5b34e68 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -244,7 +244,7 @@
 
 .. function:: findlabels(code)
 
-   Detect all offsets in the code object *code* which are jump targets, and
+   Detect all offsets in the raw compiled bytecode string *code* which are jump targets, and
    return a list of these offsets.
 
 
@@ -894,9 +894,9 @@
 
 .. opcode:: BUILD_CONST_KEY_MAP (count)
 
-   The version of :opcode:`BUILD_MAP` specialized for constant keys.  *count*
-   values are consumed from the stack.  The top element on the stack contains
-   a tuple of keys.
+   The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the
+   top element on the stack which contains a tuple of keys, then starting from
+   ``TOS1``, pops *count* values to form values in the built dictionary.
 
    .. versionadded:: 3.6
 
@@ -1198,7 +1198,7 @@
    .. versionadded:: 3.7
 
 
-.. opcode:: MAKE_FUNCTION (argc)
+.. opcode:: MAKE_FUNCTION (flags)
 
    Pushes a new function object on the stack.  From bottom to top, the consumed
    stack must consist of values if the argument carries a specified flag value
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 6feb26c..0f7df0e 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1304,7 +1304,7 @@
       the second argument to be negative, permitting computation of modular
       inverses.
 
-   .. versionchanged:: 3.9
+   .. versionchanged:: 3.8
       Allow keyword arguments.  Formerly, only positional arguments were
       supported.
 
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 3a0b554..0fb8d90 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -101,8 +101,7 @@
            return sum(sentence.count(vowel) for vowel in 'aeiou')
 
    If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can
-   grow without bound.  The LRU feature performs best when *maxsize* is a
-   power-of-two.
+   grow without bound.
 
    If *typed* is set to true, function arguments of different types will be
    cached separately.  For example, ``f(3)`` and ``f(3.0)`` will be treated
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index f15f46b..b1192e7 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -142,7 +142,9 @@
    Open a search-and-replace dialog.
 
 Go to Line
-   Move cursor to the line number requested and make that line visible.
+   Move the cursor to the beginning of the line requested and make that
+   line visible.  A request past the end of the file goes to the end.
+   Clear any selection and update the line and column status.
 
 Show Completions
    Open a scrollable list allowing selection of keywords and attributes. See
@@ -681,19 +683,22 @@
 completely remove Python and start over.
 
 A zombie pythonw.exe process could be a problem.  On Windows, use Task
-Manager to detect and stop one.  Sometimes a restart initiated by a program
-crash or Keyboard Interrupt (control-C) may fail to connect.  Dismissing
-the error box or Restart Shell on the Shell menu may fix a temporary problem.
+Manager to check for one and stop it if there is.  Sometimes a restart
+initiated by a program crash or Keyboard Interrupt (control-C) may fail
+to connect.  Dismissing the error box or using Restart Shell on the Shell
+menu may fix a temporary problem.
 
 When IDLE first starts, it attempts to read user configuration files in
 ``~/.idlerc/`` (~ is one's home directory).  If there is a problem, an error
 message should be displayed.  Leaving aside random disk glitches, this can
-be prevented by never editing the files by hand, using the configuration
-dialog, under Options, instead Options.  Once it happens, the solution may
-be to delete one or more of the configuration files.
+be prevented by never editing the files by hand.  Instead, use the
+configuration dialog, under Options.  Once there is an error in a user
+configuration file, the best solution may be to delete it and start over
+with the settings dialog.
 
 If IDLE quits with no message, and it was not started from a console, try
-starting from a console (``python -m idlelib``) and see if a message appears.
+starting it from a console or terminal (``python -m idlelib``) and see if
+this results in an error message.
 
 Running user code
 ^^^^^^^^^^^^^^^^^
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index aa22a5b..2de1043 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1029,6 +1029,10 @@
     Only class methods are defined by this class to alleviate the need for
     instantiation.
 
+    .. versionchanged:: 3.4
+       Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module`
+       methods.
+
 
 .. class:: WindowsRegistryFinder
 
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 70e0115..32151a0 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -132,12 +132,13 @@
    Opens the provided file with mode ``'rb'``. This function should be used
    when the intent is to treat the contents as executable code.
 
-   ``path`` should be an absolute path.
+   ``path`` should be a :class:`str` and an absolute path.
 
    The behavior of this function may be overridden by an earlier call to the
-   :c:func:`PyFile_SetOpenCodeHook`, however, it should always be considered
-   interchangeable with ``open(path, 'rb')``. Overriding the behavior is
-   intended for additional validation or preprocessing of the file.
+   :c:func:`PyFile_SetOpenCodeHook`. However, assuming that ``path`` is a
+   :class:`str` and an absolute path, ``open_code(path)`` should always behave
+   the same as ``open(path, 'rb')``. Overriding the behavior is intended for
+   additional validation or preprocessing of the file.
 
    .. versionadded:: 3.8
 
diff --git a/Doc/library/keyword.rst b/Doc/library/keyword.rst
index 3768df9..acec45c 100644
--- a/Doc/library/keyword.rst
+++ b/Doc/library/keyword.rst
@@ -8,16 +8,17 @@
 
 --------------
 
-This module allows a Python program to determine if a string is a keyword.
+This module allows a Python program to determine if a string is a
+:ref:`keyword <keywords>`.
 
 
 .. function:: iskeyword(s)
 
-   Return ``True`` if *s* is a Python keyword.
+   Return ``True`` if *s* is a Python :ref:`keyword <keywords>`.
 
 
 .. data:: kwlist
 
-   Sequence containing all the keywords defined for the interpreter.  If any
-   keywords are defined to only be active when particular :mod:`__future__`
-   statements are in effect, these will be included as well.
+   Sequence containing all the :ref:`keywords <keywords>` defined for the
+   interpreter.  If any keywords are defined to only be active when particular
+   :mod:`__future__` statements are in effect, these will be included as well.
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 4da5778..14e7190 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -159,6 +159,7 @@
       message format string, and the *args* are the arguments which are merged into
       *msg* using the string formatting operator. (Note that this means that you can
       use keywords in the format string, together with a single dictionary argument.)
+      No % formatting operation is performed on *msg* when no *args* are supplied.
 
       There are four keyword arguments in *kwargs* which are inspected:
       *exc_info*, *stack_info*, *stacklevel* and *extra*.
diff --git a/Doc/library/mailcap.rst b/Doc/library/mailcap.rst
index 896afd1..bf9639b 100644
--- a/Doc/library/mailcap.rst
+++ b/Doc/library/mailcap.rst
@@ -18,7 +18,7 @@
 automatically started to view the file.
 
 The mailcap format is documented in :rfc:`1524`, "A User Agent Configuration
-Mechanism For Multimedia Mail Format Information," but is not an Internet
+Mechanism For Multimedia Mail Format Information", but is not an Internet
 standard.  However, mailcap files are supported on most Unix systems.
 
 
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 492f94c..ec9521f 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -439,7 +439,8 @@
       >>> def f(x):
       ...     return x*x
       ...
-      >>> p.map(f, [1,2,3])
+      >>> with p:
+      ...   p.map(f, [1,2,3])
       Process PoolWorker-1:
       Process PoolWorker-2:
       Process PoolWorker-3:
@@ -2127,6 +2128,16 @@
    Note that the methods of the pool object should only be called by
    the process which created the pool.
 
+   .. warning::
+      :class:`multiprocessing.pool` objects have internal resources that need to be
+      properly managed (like any other resource) by using the pool as a context manager
+      or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this
+      can lead to the process hanging on finalization.
+
+      Note that is **not correct** to rely on the garbage colletor to destroy the pool
+      as CPython does not assure that the finalizer of the pool will be called
+      (see :meth:`object.__del__` for more information).
+
    .. versionadded:: 3.2
       *maxtasksperchild*
 
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 3157b88..77bbf99 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -4128,28 +4128,36 @@
    Return ``True`` if a core dump was generated for the process, otherwise
    return ``False``.
 
+   This function should be employed only if :func:`WIFSIGNALED` is true.
+
    .. availability:: Unix.
 
 
 .. function:: WIFCONTINUED(status)
 
-   Return ``True`` if the process has been continued from a job control stop,
-   otherwise return ``False``.
+   Return ``True`` if a stopped child has been resumed by delivery of
+   :data:`~signal.SIGCONT` (if the process has been continued from a job
+   control stop), otherwise return ``False``.
+
+   See :data:`WCONTINUED` option.
 
    .. availability:: Unix.
 
 
 .. function:: WIFSTOPPED(status)
 
-   Return ``True`` if the process has been stopped, otherwise return
-   ``False``.
+   Return ``True`` if the process was stopped by delivery of a signal,
+   otherwise return ``False``.
+
+   :func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was
+   done using :data:`WUNTRACED` option or when the process is being traced (see
+   :manpage:`ptrace(2)`).
 
    .. availability:: Unix.
 
-
 .. function:: WIFSIGNALED(status)
 
-   Return ``True`` if the process exited due to a signal, otherwise return
+   Return ``True`` if the process was terminated by a signal, otherwise return
    ``False``.
 
    .. availability:: Unix.
@@ -4157,7 +4165,8 @@
 
 .. function:: WIFEXITED(status)
 
-   Return ``True`` if the process exited using the :manpage:`exit(2)` system call,
+   Return ``True`` if the process exited terminated normally, that is,
+   by calling ``exit()`` or ``_exit()``, or by returning from ``main()``;
    otherwise return ``False``.
 
    .. availability:: Unix.
@@ -4165,8 +4174,9 @@
 
 .. function:: WEXITSTATUS(status)
 
-   If ``WIFEXITED(status)`` is true, return the integer parameter to the
-   :manpage:`exit(2)` system call.  Otherwise, the return value is meaningless.
+   Return the process exit status.
+
+   This function should be employed only if :func:`WIFEXITED` is true.
 
    .. availability:: Unix.
 
@@ -4175,12 +4185,16 @@
 
    Return the signal which caused the process to stop.
 
+   This function should be employed only if :func:`WIFSTOPPED` is true.
+
    .. availability:: Unix.
 
 
 .. function:: WTERMSIG(status)
 
-   Return the signal which caused the process to exit.
+   Return the number of the signal that caused the process to terminate.
+
+   This function should be employed only if :func:`WIFSIGNALED` is true.
 
    .. availability:: Unix.
 
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 326bb2e..b900d09 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -515,8 +515,10 @@
       >>> PurePath('a/b.py').match('/*.py')
       False
 
-   As with other methods, case-sensitivity is observed::
+   As with other methods, case-sensitivity follows platform defaults::
 
+      >>> PurePosixPath('b.py').match('*.PY')
+      False
       >>> PureWindowsPath('b.py').match('*.PY')
       True
 
@@ -672,7 +674,7 @@
 
 .. method:: Path.stat()
 
-   Return information about this path (similarly to :func:`os.stat`).
+   Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`.
    The result is looked up at each call to this method.
 
    ::
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 779b60e..d92e947 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -252,10 +252,10 @@
    .. versionchanged:: 3.8
       The *buffers* argument was added.
 
-.. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
+.. function:: loads(data, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
 
    Return the reconstituted object hierarchy of the pickled representation
-   *bytes_object* of an object.
+   *data* of an object. *data* must be a :term:`bytes-like object`.
 
    The protocol version of the pickle is detected automatically, so no
    protocol argument is needed.  Bytes past the pickled representation
@@ -639,9 +639,9 @@
    At unpickling time, some methods like :meth:`__getattr__`,
    :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the
    instance.  In case those methods rely on some internal invariant being
-   true, the type should implement :meth:`__getnewargs__` or
-   :meth:`__getnewargs_ex__` to establish such an invariant; otherwise,
-   neither :meth:`__new__` nor :meth:`__init__` will be called.
+   true, the type should implement :meth:`__new__` to establish such an
+   invariant, as :meth:`__init__` is not called when unpickling an
+   instance.
 
 .. index:: pair: copy; protocol
 
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
index 9abf286..b8b7f42 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -144,7 +144,7 @@
 
    .. index:: builtin: eval
 
-   Determine if the formatted representation of *object* is "readable," or can be
+   Determine if the formatted representation of *object* is "readable", or can be
    used to reconstruct the value using :func:`eval`.  This always returns ``False``
    for recursive objects.
 
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index 2eeab5e..0ec5900 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -190,32 +190,28 @@
 
 Example of how to wait for enqueued tasks to be completed::
 
+    import threading, queue
+
+    q = queue.Queue()
+
     def worker():
         while True:
             item = q.get()
-            if item is None:
-                break
-            do_work(item)
+            print(f'Working on {item}')
+            print(f'Finished {item}')
             q.task_done()
 
-    q = queue.Queue()
-    threads = []
-    for i in range(num_worker_threads):
-        t = threading.Thread(target=worker)
-        t.start()
-        threads.append(t)
+    # turn-on the worker thread
+    threading.Thread(target=worker, daemon=True).start()
 
-    for item in source():
+    # send thirty task requests to the worker
+    for item in range(30):
         q.put(item)
+    print('All task requests sent\n', end='')
 
     # block until all tasks are done
     q.join()
-
-    # stop workers
-    for i in range(num_worker_threads):
-        q.put(None)
-    for t in threads:
-        t.join()
+    print('All work completed')
 
 
 SimpleQueue Objects
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index 90b8624..2149e80 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -102,7 +102,7 @@
 .. function:: getrandbits(k)
 
    Returns a Python integer with *k* random bits. This method is supplied with
-   the MersenneTwister generator and some other generators may also provide it
+   the Mersenne Twister generator and some other generators may also provide it
    as an optional part of the API. When available, :meth:`getrandbits` enables
    :meth:`randrange` to handle arbitrarily large ranges.
 
@@ -394,29 +394,28 @@
    >>> def trial():
    ...     return choices('HT', cum_weights=(0.60, 1.00), k=7).count('H') >= 5
    ...
-   >>> sum(trial() for i in range(10000)) / 10000
+   >>> sum(trial() for i in range(10_000)) / 10_000
    0.4169
 
    >>> # Probability of the median of 5 samples being in middle two quartiles
    >>> def trial():
-   ...     return 2500 <= sorted(choices(range(10000), k=5))[2] < 7500
+   ...     return 2_500 <= sorted(choices(range(10_000), k=5))[2] < 7_500
    ...
-   >>> sum(trial() for i in range(10000)) / 10000
+   >>> sum(trial() for i in range(10_000)) / 10_000
    0.7958
 
 Example of `statistical bootstrapping
 <https://en.wikipedia.org/wiki/Bootstrapping_(statistics)>`_ using resampling
-with replacement to estimate a confidence interval for the mean of a sample of
-size five::
+with replacement to estimate a confidence interval for the mean of a sample::
 
    # http://statistics.about.com/od/Applications/a/Example-Of-Bootstrapping.htm
    from statistics import fmean as mean
    from random import choices
 
-   data = 1, 2, 4, 4, 10
-   means = sorted(mean(choices(data, k=5)) for i in range(20))
+   data = [41, 50, 29, 37, 81, 30, 73, 63, 20, 35, 68, 22, 60, 31, 95]
+   means = sorted(mean(choices(data, k=len(data))) for i in range(100))
    print(f'The sample mean of {mean(data):.1f} has a 90% confidence '
-         f'interval from {means[1]:.1f} to {means[-2]:.1f}')
+         f'interval from {means[5]:.1f} to {means[94]:.1f}')
 
 Example of a `resampling permutation test
 <https://en.wikipedia.org/wiki/Resampling_(statistics)#Permutation_tests>`_
@@ -432,7 +431,7 @@
     placebo = [54, 51, 58, 44, 55, 52, 42, 47, 58, 46]
     observed_diff = mean(drug) - mean(placebo)
 
-    n = 10000
+    n = 10_000
     count = 0
     combined = drug + placebo
     for i in range(n):
@@ -445,32 +444,29 @@
     print(f'The one-sided p-value of {count / n:.4f} leads us to reject the null')
     print(f'hypothesis that there is no difference between the drug and the placebo.')
 
-Simulation of arrival times and service deliveries in a single server queue::
+Simulation of arrival times and service deliveries for a multiserver queue::
 
+    from heapq import heappush, heappop
     from random import expovariate, gauss
     from statistics import mean, median, stdev
 
     average_arrival_interval = 5.6
-    average_service_time = 5.0
-    stdev_service_time = 0.5
+    average_service_time = 15.0
+    stdev_service_time = 3.5
+    num_servers = 3
 
-    num_waiting = 0
-    arrivals = []
-    starts = []
-    arrival = service_end = 0.0
-    for i in range(20000):
-        if arrival <= service_end:
-            num_waiting += 1
-            arrival += expovariate(1.0 / average_arrival_interval)
-            arrivals.append(arrival)
-        else:
-            num_waiting -= 1
-            service_start = service_end if num_waiting else arrival
-            service_time = gauss(average_service_time, stdev_service_time)
-            service_end = service_start + service_time
-            starts.append(service_start)
+    waits = []
+    arrival_time = 0.0
+    servers = [0.0] * num_servers  # time when each server becomes available
+    for i in range(100_000):
+        arrival_time += expovariate(1.0 / average_arrival_interval)
+        next_server_available = heappop(servers)
+        wait = max(0.0, next_server_available - arrival_time)
+        waits.append(wait)
+        service_duration = gauss(average_service_time, stdev_service_time)
+        service_completed = arrival_time + wait + service_duration
+        heappush(servers, service_completed)
 
-    waits = [start - arrival for arrival, start in zip(arrivals, starts)]
     print(f'Mean wait: {mean(waits):.1f}.  Stdev wait: {stdev(waits):.1f}.')
     print(f'Median wait: {median(waits):.1f}.  Max wait: {max(waits):.1f}.')
 
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 7c950bf..9abbd8b 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1617,10 +1617,14 @@
 to combine those into a single master regular expression and to loop over
 successive matches::
 
-    import collections
+    from typing import NamedTuple
     import re
 
-    Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column'])
+    class Token(NamedTuple):
+        type: str
+        value: str
+        line: int
+        column: int
 
     def tokenize(code):
         keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index 932201b..5488f4a 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -91,6 +91,110 @@
    signal.
 
 
+.. data:: SIGABRT
+
+   Abort signal from :manpage:`abort(3)`.
+
+.. data:: SIGALRM
+
+   Timer signal from :manpage:`alarm(2)`.
+
+   .. availability:: Unix.
+
+.. data:: SIGBREAK
+
+   Interrupt from keyboard (CTRL + BREAK).
+
+   .. availability:: Windows.
+
+.. data:: SIGBUS
+
+   Bus error (bad memory access).
+
+   .. availability:: Unix.
+
+.. data:: SIGCHLD
+
+   Child process stopped or terminated.
+
+   .. availability:: Windows.
+
+.. data:: SIGCLD
+
+   Alias to :data:`SIGCHLD`.
+
+.. data:: SIGCONT
+
+   Continue the process if it is currently stopped
+
+   .. availability:: Unix.
+
+.. data:: SIGFPE
+
+   Floating-point exception. For example, division by zero.
+
+   .. seealso::
+      :exc:`ZeroDivisionError` is raised when the second argument of a division
+      or modulo operation is zero.
+
+.. data:: SIGHUP
+
+   Hangup detected on controlling terminal or death of controlling process.
+
+   .. availability:: Unix.
+
+.. data:: SIGILL
+
+   Illegal instruction.
+
+.. data:: SIGINT
+
+   Interrupt from keyboard (CTRL + C).
+
+   Default action is to raise :exc:`KeyboardInterrupt`.
+
+.. data:: SIGKILL
+
+   Kill signal.
+
+   It cannot be caught, blocked, or ignored.
+
+   .. availability:: Unix.
+
+.. data:: SIGPIPE
+
+   Broken pipe: write to pipe with no readers.
+
+   Default action is to ignore the signal.
+
+   .. availability:: Unix.
+
+.. data:: SIGSEGV
+
+   Segmentation fault: invalid memory reference.
+
+.. data:: SIGTERM
+
+   Termination signal.
+
+.. data:: SIGUSR1
+
+   User-defined signal 1.
+
+   .. availability:: Unix.
+
+.. data:: SIGUSR2
+
+   User-defined signal 2.
+
+   .. availability:: Unix.
+
+.. data:: SIGWINCH
+
+   Window resize signal.
+
+   .. availability:: Unix.
+
 .. data:: SIG*
 
    All the signal numbers are defined symbolically.  For example, the hangup signal
@@ -297,6 +401,8 @@
    For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the
    signal mask of the calling thread.
 
+   :data:`SIGKILL` and :data:`SIGSTOP` cannot be blocked.
+
    .. availability:: Unix.  See the man page :manpage:`sigprocmask(3)` and
       :manpage:`pthread_sigmask(3)` for further information.
 
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
index 7c8c8d5..232c061 100644
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -237,6 +237,8 @@
    .. method:: shutdown()
 
       Tell the :meth:`serve_forever` loop to stop and wait until it does.
+      :meth:`shutdown` must be called while :meth:`serve_forever` is running in a
+      different thread otherwise it will deadlock.
 
 
    .. method:: server_close()
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 67ea2b1..314d3a5 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -165,9 +165,10 @@
    that 'mytype' is the type of the column. It will try to find an entry of
    'mytype' in the converters dictionary and then use the converter function found
    there to return the value. The column name found in :attr:`Cursor.description`
-   is only the first word of the column name, i.  e. if you use something like
-   ``'as "x [datetime]"'`` in your SQL, then we will parse out everything until the
-   first blank for the column name: the column name would simply be "x".
+   does not include the type, i. e. if you use something like
+   ``'as "Expiration date [datetime]"'`` in your SQL, then we will parse out
+   everything until the first ``'['`` for the column name and strip
+   the preceeding space: the column name would simply be "Expiration date".
 
 
 .. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri])
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index bbb4c41..4142e41 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -42,7 +42,7 @@
 :class:`socket.socket` type, and provides a socket-like wrapper that also
 encrypts and decrypts the data going over the socket with SSL.  It supports
 additional methods such as :meth:`getpeercert`, which retrieves the
-certificate of the other side of the connection, and :meth:`cipher`,which
+certificate of the other side of the connection, and :meth:`cipher`, which
 retrieves the cipher being used for the secure connection.
 
 For more sophisticated applications, the :class:`ssl.SSLContext` class
@@ -2271,7 +2271,7 @@
                 (('postalCode', '03894-4801'),),
                 (('countryName', 'US'),),
                 (('stateOrProvinceName', 'NH'),),
-                (('localityName', 'Wolfeboro,'),),
+                (('localityName', 'Wolfeboro'),),
                 (('organizationName', 'Python Software Foundation'),),
                 (('commonName', 'www.python.org'),)),
     'subjectAltName': (('DNS', 'www.python.org'),
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index d369b38..8cc57c3 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -261,8 +261,10 @@
 Python fully supports mixed arithmetic: when a binary arithmetic operator has
 operands of different numeric types, the operand with the "narrower" type is
 widened to that of the other, where integer is narrower than floating point,
-which is narrower than complex.  Comparisons between numbers of mixed type use
-the same rule. [2]_ The constructors :func:`int`, :func:`float`, and
+which is narrower than complex. A comparison between numbers of different types
+behaves as though the exact values of those numbers were being compared. [2]_
+
+The constructors :func:`int`, :func:`float`, and
 :func:`complex` can be used to produce numbers of a specific type.
 
 All numeric types (except complex) support the following operations (for priorities of
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 89c169a..fa906f7 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -302,9 +302,9 @@
 Most built-in types implement the following options for format specifications,
 although some of the formatting options are only supported by the numeric types.
 
-A general convention is that an empty format string (``""``) produces
+A general convention is that an empty format specification produces
 the same result as if you had called :func:`str` on the value. A
-non-empty format string typically modifies the result.
+non-empty format specification typically modifies the result.
 
 The general form of a *standard format specifier* is:
 
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index 0f11ef4..1683710 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -239,7 +239,7 @@
       :attr:`fix_sentence_endings` is false by default.
 
       Since the sentence detection algorithm relies on ``string.lowercase`` for
-      the definition of "lowercase letter," and a convention of using two spaces
+      the definition of "lowercase letter", and a convention of using two spaces
       after a period to separate sentences on the same line, it is specific to
       English-language texts.
 
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index ef7a4e4..46fa62c 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -251,7 +251,8 @@
 similarly.
 
 If :option:`-n` is not given, a suitable number of loops is calculated by trying
-successive powers of 10 until the total time is at least 0.2 seconds.
+increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the total
+time is at least 0.2 seconds.
 
 :func:`default_timer` measurements can be affected by other programs running on
 the same machine, so the best thing to do when accurate timing is necessary is
diff --git a/Doc/library/token.rst b/Doc/library/token.rst
index 1777929..dab8f0f 100644
--- a/Doc/library/token.rst
+++ b/Doc/library/token.rst
@@ -87,7 +87,7 @@
    now tokenized as :data:`NAME` tokens.
 
 .. versionchanged:: 3.8
-   Added :data:`TYPE_COMMENT`.
+   Added :data:`TYPE_COMMENT`, :data:`TYPE_IGNORE`, :data:`COLONEQUAL`.
    Added :data:`AWAIT` and :data:`ASYNC` tokens back (they're needed
    to support parsing older Python versions for :func:`ast.parse` with
    ``feature_version`` set to 6 or lower).
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
index 96778f2..11f569d 100644
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -13,7 +13,7 @@
 
 The :mod:`tokenize` module provides a lexical scanner for Python source code,
 implemented in Python.  The scanner in this module returns comments as tokens
-as well, making it useful for implementing "pretty-printers," including
+as well, making it useful for implementing "pretty-printers", including
 colorizers for on-screen displays.
 
 To simplify token stream handling, all :ref:`operator <operators>` and
diff --git a/Doc/library/tracemalloc.rst b/Doc/library/tracemalloc.rst
index 2d327c0..000c0ee 100644
--- a/Doc/library/tracemalloc.rst
+++ b/Doc/library/tracemalloc.rst
@@ -202,10 +202,8 @@
         print("Top %s lines" % limit)
         for index, stat in enumerate(top_stats[:limit], 1):
             frame = stat.traceback[0]
-            # replace "/path/to/module/file.py" with "module/file.py"
-            filename = os.sep.join(frame.filename.split(os.sep)[-2:])
             print("#%s: %s:%s: %.1f KiB"
-                  % (index, filename, frame.lineno, stat.size / 1024))
+                  % (index, frame.filename, frame.lineno, stat.size / 1024))
             line = linecache.getline(frame.filename, frame.lineno).strip()
             if line:
                 print('    %s' % line)
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index a9c7c47..7269e18 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -959,7 +959,7 @@
    .. versionchanged:: 3.6.1
       Added support for default values, methods, and docstrings.
 
-   .. versionchanged:: 3.8
+   .. deprecated-removed:: 3.8 3.9
       Deprecated the ``_field_types`` attribute in favor of the more
       standard ``__annotations__`` attribute which has the same information.
 
@@ -1004,7 +1004,7 @@
           x: int
           y: int
 
-   This means that a point2D TypedDict can have any of the keys omitted.A type
+   This means that a point2D TypedDict can have any of the keys omitted. A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index a559d09..d9f080a 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -910,10 +910,10 @@
       .. versionadded:: 3.1
 
 
-   .. method:: assertIn(first, second, msg=None)
-               assertNotIn(first, second, msg=None)
+   .. method:: assertIn(member, container, msg=None)
+               assertNotIn(member, container, msg=None)
 
-      Test that *first* is (or is not) in *second*.
+      Test that *member* is (or is not) in *container*.
 
       .. versionadded:: 3.1
 
diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst
index 7283152..fb40a2b 100644
--- a/Doc/library/zipapp.rst
+++ b/Doc/library/zipapp.rst
@@ -198,7 +198,7 @@
 The same can be done using the :func:`create_archive` function::
 
    >>> import zipapp
-   >>> zipapp.create_archive('myapp.pyz', 'myapp')
+   >>> zipapp.create_archive('myapp', 'myapp.pyz')
 
 To make the application directly executable on POSIX, specify an interpreter
 to use.
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index e8a2530..97da6ca 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -494,6 +494,12 @@
    Invoke :meth:`ZipFile.open` on the current path. Accepts
    the same arguments as :meth:`ZipFile.open`.
 
+   .. caution::
+
+      The signature on this function changes in an incompatible way
+      in Python 3.9. For a future-compatible version, consider using
+      the third-party zipp.Path package (3.0 or later).
+
 .. method:: Path.iterdir()
 
    Enumerate the children of the current directory.
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 564d6cc..feaf310 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -90,8 +90,8 @@
 The :keyword:`if` statement is used for conditional execution:
 
 .. productionlist::
-   if_stmt: "if" `expression` ":" `suite`
-          : ("elif" `expression` ":" `suite`)*
+   if_stmt: "if" `assignment_expression` ":" `suite`
+          : ("elif" `assignment_expression` ":" `suite`)*
           : ["else" ":" `suite`]
 
 It selects exactly one of the suites by evaluating the expressions one by one
@@ -116,7 +116,7 @@
 expression is true:
 
 .. productionlist::
-   while_stmt: "while" `expression` ":" `suite`
+   while_stmt: "while" `assignment_expression` ":" `suite`
              : ["else" ":" `suite`]
 
 This repeatedly tests the expression and, if it is true, executes the first
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 06f4992..d364e61 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -17,7 +17,7 @@
 
 :dfn:`Objects` are Python's abstraction for data.  All data in a Python program
 is represented by objects or by relations between objects. (In a sense, and in
-conformance to Von Neumann's model of a "stored program computer," code is also
+conformance to Von Neumann's model of a "stored program computer", code is also
 represented by objects.)
 
 .. index::
@@ -420,6 +420,11 @@
       equal (e.g., ``1`` and ``1.0``) then they can be used interchangeably to index
       the same dictionary entry.
 
+      Dictionaries preserve insertion order, meaning that keys will be produced
+      in the same order they were added sequentially over the dictionary.
+      Replacing an existing key does not change the order, however removing a key
+      and re-inserting it will add it to the end instead of keeping its old place.
+
       Dictionaries are mutable; they can be created by the ``{...}`` notation (see
       section :ref:`dict`).
 
@@ -431,6 +436,11 @@
       additional examples of mapping types, as does the :mod:`collections`
       module.
 
+      .. versionchanged:: 3.7
+         Dictionaries did not preserve insertion order in versions of Python before 3.6.
+         In CPython 3.6, insertion order was preserved, but it was considered
+         an implementation detail at that time rather than a language guarantee.
+
 Callable types
    .. index::
       object: callable
@@ -1951,7 +1961,7 @@
 the final class object is created the namespace is copied into a new ``dict``.
 
 If the metaclass has no ``__prepare__`` attribute, then the class namespace
-is initialised as an empty :func:`dict`.
+is initialised as an empty ordered mapping.
 
 .. seealso::
 
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index d9db33a..8036a49 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -28,7 +28,7 @@
 .. index:: pair: arithmetic; conversion
 
 When a description of an arithmetic operator below uses the phrase "the numeric
-arguments are converted to a common type," this means that the operator
+arguments are converted to a common type", this means that the operator
 implementation for built-in types works as follows:
 
 * If either argument is a complex number, the other is converted to complex;
@@ -178,7 +178,7 @@
 Common syntax elements for comprehensions are:
 
 .. productionlist::
-   comprehension: `expression` `comp_for`
+   comprehension: `assignment_expression` `comp_for`
    comp_for: ["async"] "for" `target_list` "in" `or_test` [`comp_iter`]
    comp_iter: `comp_for` | `comp_if`
    comp_if: "if" `expression_nocond` [`comp_iter`]
@@ -911,7 +911,8 @@
                 :   ["," `keywords_arguments`]
                 : | `starred_and_keywords` ["," `keywords_arguments`]
                 : | `keywords_arguments`
-   positional_arguments: ["*"] `expression` ("," ["*"] `expression`)*
+   positional_arguments: positional_item ("," positional_item)*
+   positional_item: `assignment_expression` | "*" `expression`
    starred_and_keywords: ("*" `expression` | `keyword_item`)
                 : ("," "*" `expression` | "," `keyword_item`)*
    keywords_arguments: (`keyword_item` | "**" `expression`)
@@ -1421,8 +1422,9 @@
   The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are
   special.  Any ordered comparison of a number to a not-a-number value is false.
   A counter-intuitive implication is that not-a-number values are not equal to
-  themselves.  For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3``, ``x
-  == x``, ``x != x`` are all false.  This behavior is compliant with IEEE 754.
+  themselves.  For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3`` and
+  ``x == x`` are all false, while ``x != x`` is true.  This behavior is
+  compliant with IEEE 754.
 
 * ``None`` and ``NotImplemented`` are singletons.  :PEP:`8` advises that
   comparisons for singletons should always be done with ``is`` or ``is not``,
@@ -1642,6 +1644,17 @@
 (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)
 
 
+Assignment expressions
+======================
+
+.. productionlist::
+   assignment_expression: [`identifier` ":="] `expression`
+
+.. TODO: BPO-39868
+
+See :pep:`572` for more details about assignment expressions.
+
+
 .. _if_expr:
 
 Conditional expressions
@@ -1711,7 +1724,7 @@
    expression_list: `expression` ("," `expression`)* [","]
    starred_list: `starred_item` ("," `starred_item`)* [","]
    starred_expression: `expression` | (`starred_item` ",")* [`starred_item`]
-   starred_item: `expression` | "*" `or_expr`
+   starred_item: `assignment_expression` | "*" `or_expr`
 
 .. index:: object: tuple
 
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 3d4b03e..844bd7c 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -376,11 +376,11 @@
       information on this convention.
 
 ``__*__``
-   System-defined names. These names are defined by the interpreter and its
-   implementation (including the standard library).  Current system names are
-   discussed in the :ref:`specialnames` section and elsewhere.  More will likely
-   be defined in future versions of Python.  *Any* use of ``__*__`` names, in
-   any context, that does not follow explicitly documented use, is subject to
+   System-defined names, informally known as "dunder" names. These names are
+   defined by the interpreter and its implementation (including the standard library).
+   Current system names are discussed in the :ref:`specialnames` section and elsewhere.
+   More will likely be defined in future versions of Python.  *Any* use of ``__*__`` names,
+   in any context, that does not follow explicitly documented use, is subject to
    breakage without warning.
 
 ``__*``
diff --git a/Doc/tools/templates/download.html b/Doc/tools/templates/download.html
index d9364d6..987c63a 100644
--- a/Doc/tools/templates/download.html
+++ b/Doc/tools/templates/download.html
@@ -40,7 +40,7 @@
 
 <p>These archives contain all the content in the documentation.</p>
 
-<p>HTML Help (<tt>.chm</tt>) files are made available in the "Windows" section
+<p>HTML Help (<code>.chm</code>) files are made available in the "Windows" section
 on the <a href="https://www.python.org/downloads/release/python-{{ release.replace('.', '') }}/">Python
 download page</a>.</p>
 
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index f781fec..06bdd0d 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -323,7 +323,7 @@
 
 Now what can we do with instance objects?  The only operations understood by
 instance objects are attribute references.  There are two kinds of valid
-attribute names, data attributes and methods.
+attribute names: data attributes and methods.
 
 *data attributes* correspond to "instance variables" in Smalltalk, and to "data
 members" in C++.  Data attributes need not be declared; like local variables,
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 53206c7..d3f0400 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -109,8 +109,8 @@
    Many standard library modules contain code that is invoked on their execution
    as a script.  An example is the :mod:`timeit` module::
 
-       python -mtimeit -s 'setup here' 'benchmarked code here'
-       python -mtimeit -h # for details
+       python -m timeit -s 'setup here' 'benchmarked code here'
+       python -m timeit -h # for details
 
    .. audit-event:: cpython.run_module module-name cmdoption-m
 
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc
index 1b24721..99b2a19 100644
--- a/Doc/using/venv-create.inc
+++ b/Doc/using/venv-create.inc
@@ -78,6 +78,17 @@
    particular note is that double-clicking ``python.exe`` in File Explorer
    will resolve the symlink eagerly and ignore the virtual environment.
 
+.. note::
+   On Microsoft Windows, it may be required to enable the ``Activate.ps1``
+   script by setting the execution policy for the user. You can do this by
+   issuing the following PowerShell command:
+
+   PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
+
+   See `About Execution Policies
+   <ttps:/go.microsoft.com/fwlink/?LinkID=135170>`_
+   for more information.
+
 The created ``pyvenv.cfg`` file also includes the
 ``include-system-site-packages`` key, set to ``true`` if ``venv`` is
 run with the ``--system-site-packages`` option, ``false`` otherwise.
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
index 880958d..6b8bd88 100644
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -2,6 +2,8 @@
   What's New In Python 3.0
 ****************************
 
+TEST CHANGE TO BE UNDONE
+
 .. XXX Add trademark info for Apple, Microsoft.
 
 :Author: Guido van Rossum
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 3ef97c9..d2db5bf 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -144,12 +144,11 @@
 
 One use case for this notation is that it allows pure Python functions
 to fully emulate behaviors of existing C coded functions.  For example,
-the built-in :func:`pow` function does not accept keyword arguments::
+the built-in :func:`divmod` function does not accept keyword arguments::
 
-  def pow(x, y, z=None, /):
-      "Emulate the built in pow() function"
-      r = x ** y
-      return r if z is None else r%z
+  def divmod(a, b, /):
+      "Emulate the built in divmod() function"
+      return (a // b, a % b)
 
 Another use case is to preclude keyword arguments when the parameter
 name is not helpful.  For example, the builtin :func:`len` function has
@@ -2211,7 +2210,13 @@
     Timing loop:
         loop_overhead                    0.3     0.5     0.6     0.4     0.3     0.3
 
-    (Measured from the macOS 64-bit builds found at python.org)
+The benchmarks were measured on an
+`Intel® Core™ i7-4960HQ processor
+<https://ark.intel.com/content/www/us/en/ark/products/76088/intel-core-i7-4960hq-processor-6m-cache-up-to-3-80-ghz.html>`_
+running the macOS 64-bit builds found at
+`python.org <https://www.python.org/downloads/mac-osx/>`_.
+The benchmark script displays timings in nanoseconds.
+
 
 Notable changes in Python 3.8.1
 ===============================
@@ -2229,3 +2234,11 @@
 Fixed a regression with the ``ignore`` callback of :func:`shutil.copytree`.
 The argument types are now str and List[str] again.
 (Contributed by Manuel Barkhau and Giampaolo Rodola in :issue:`39390`.)
+
+Notable changes in Python 3.8.3
+===============================
+
+The constant values of future flags in the :mod:`__future__` module
+are updated in order to prevent collision with compiler flags. Previously
+``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``.
+(Contributed by Batuhan Taskaya in :issue:`39562`)
diff --git a/Include/code.h b/Include/code.h
index 3afddd2..a1cd58f 100644
--- a/Include/code.h
+++ b/Include/code.h
@@ -88,19 +88,19 @@
 #define CO_ITERABLE_COROUTINE   0x0100
 #define CO_ASYNC_GENERATOR      0x0200
 
-/* These are no longer used. */
-#if 0
-#define CO_GENERATOR_ALLOWED    0x1000
-#endif
-#define CO_FUTURE_DIVISION      0x2000
-#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
-#define CO_FUTURE_WITH_STATEMENT  0x8000
-#define CO_FUTURE_PRINT_FUNCTION  0x10000
-#define CO_FUTURE_UNICODE_LITERALS 0x20000
+/* bpo-39562: These constant values are changed in Python 3.9
+   to prevent collision with compiler flags. CO_FUTURE_ and PyCF_
+   constants must be kept unique. PyCF_ constants can use bits from
+   0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */
+#define CO_FUTURE_DIVISION      0x20000
+#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */
+#define CO_FUTURE_WITH_STATEMENT  0x80000
+#define CO_FUTURE_PRINT_FUNCTION  0x100000
+#define CO_FUTURE_UNICODE_LITERALS 0x200000
 
-#define CO_FUTURE_BARRY_AS_BDFL  0x40000
-#define CO_FUTURE_GENERATOR_STOP  0x80000
-#define CO_FUTURE_ANNOTATIONS    0x100000
+#define CO_FUTURE_BARRY_AS_BDFL  0x400000
+#define CO_FUTURE_GENERATOR_STOP  0x800000
+#define CO_FUTURE_ANNOTATIONS    0x1000000
 
 /* This value is found in the co_cell2arg array when the associated cell
    variable does not correspond to an argument. */
diff --git a/Include/compile.h b/Include/compile.h
index 1cda955..015584d 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -18,12 +18,18 @@
                    CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \
                    CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS)
 #define PyCF_MASK_OBSOLETE (CO_NESTED)
+
+/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique.
+   PyCF_ constants can use bits from 0x0100 to 0x10000.
+   CO_FUTURE_ constants use bits starting at 0x20000. */
 #define PyCF_SOURCE_IS_UTF8  0x0100
 #define PyCF_DONT_IMPLY_DEDENT 0x0200
 #define PyCF_ONLY_AST 0x0400
 #define PyCF_IGNORE_COOKIE 0x0800
 #define PyCF_TYPE_COMMENTS 0x1000
 #define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000
+#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \
+                           PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT)
 
 #ifndef Py_LIMITED_API
 typedef struct {
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 94b0809..e22b053 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -55,6 +55,7 @@
     struct _ts *next;
     PyInterpreterState *interp;
 
+    /* Borrowed reference to the current frame (it can be NULL) */
     struct _frame *frame;
     int recursion_depth;
     char overflowed; /* The stack has overflowed. Allow 50 more calls
diff --git a/Include/object.h b/Include/object.h
index cc98d8a..5558f65 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -29,7 +29,7 @@
 Types themselves are represented as objects; an object contains a
 pointer to the corresponding type object.  The type itself has a type
 pointer pointing to the object representing the type 'type', which
-contains a pointer to itself!).
+contains a pointer to itself!.
 
 Objects do not float around in memory; once allocated an object keeps
 the same size and address.  Objects that must hold variable-size data
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 3671bb3..2f6a68f 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -18,12 +18,12 @@
 /*--start constants--*/
 #define PY_MAJOR_VERSION        3
 #define PY_MINOR_VERSION        8
-#define PY_MICRO_VERSION        2
+#define PY_MICRO_VERSION        3
 #define PY_RELEASE_LEVEL        PY_RELEASE_LEVEL_FINAL
 #define PY_RELEASE_SERIAL       0
 
 /* Version as a string */
-#define PY_VERSION              "3.8.2"
+#define PY_VERSION              "3.8.3"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Lib/__future__.py b/Lib/__future__.py
index e113568..d7cb8ac 100644
--- a/Lib/__future__.py
+++ b/Lib/__future__.py
@@ -68,14 +68,14 @@
 # this module.
 CO_NESTED            = 0x0010   # nested_scopes
 CO_GENERATOR_ALLOWED = 0        # generators (obsolete, was 0x1000)
-CO_FUTURE_DIVISION   = 0x2000   # division
-CO_FUTURE_ABSOLUTE_IMPORT = 0x4000 # perform absolute imports by default
-CO_FUTURE_WITH_STATEMENT  = 0x8000   # with statement
-CO_FUTURE_PRINT_FUNCTION  = 0x10000   # print function
-CO_FUTURE_UNICODE_LITERALS = 0x20000 # unicode string literals
-CO_FUTURE_BARRY_AS_BDFL = 0x40000
-CO_FUTURE_GENERATOR_STOP  = 0x80000 # StopIteration becomes RuntimeError in generators
-CO_FUTURE_ANNOTATIONS     = 0x100000  # annotations become strings at runtime
+CO_FUTURE_DIVISION   = 0x20000   # division
+CO_FUTURE_ABSOLUTE_IMPORT = 0x40000 # perform absolute imports by default
+CO_FUTURE_WITH_STATEMENT  = 0x80000   # with statement
+CO_FUTURE_PRINT_FUNCTION  = 0x100000   # print function
+CO_FUTURE_UNICODE_LITERALS = 0x200000 # unicode string literals
+CO_FUTURE_BARRY_AS_BDFL = 0x400000
+CO_FUTURE_GENERATOR_STOP  = 0x800000 # StopIteration becomes RuntimeError in generators
+CO_FUTURE_ANNOTATIONS     = 0x1000000  # annotations become strings at runtime
 
 class _Feature:
     def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
index db6674e..e9efce7 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -211,7 +211,7 @@
         if cv in _config_vars and cv not in os.environ:
             flags = _config_vars[cv]
             flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII)
-            flags = re.sub('-isysroot [^ \t]*', ' ', flags)
+            flags = re.sub(r'-isysroot\s*\S+', ' ', flags)
             _save_modified_value(_config_vars, cv, flags)
 
     return _config_vars
@@ -287,7 +287,7 @@
     # to /usr and /System/Library by either a standalone CLT
     # package or the CLT component within Xcode.
     cflags = _config_vars.get('CFLAGS', '')
-    m = re.search(r'-isysroot\s+(\S+)', cflags)
+    m = re.search(r'-isysroot\s*(\S+)', cflags)
     if m is not None:
         sdk = m.group(1)
         if not os.path.exists(sdk):
@@ -295,7 +295,7 @@
                 # Do not alter a config var explicitly overridden by env var
                 if cv in _config_vars and cv not in os.environ:
                     flags = _config_vars[cv]
-                    flags = re.sub(r'-isysroot\s+\S+(?:\s|$)', ' ', flags)
+                    flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags)
                     _save_modified_value(_config_vars, cv, flags)
 
     return _config_vars
@@ -320,7 +320,7 @@
         stripArch = stripSysroot = True
     else:
         stripArch = '-arch' in cc_args
-        stripSysroot = '-isysroot' in cc_args
+        stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot'))
 
     if stripArch or 'ARCHFLAGS' in os.environ:
         while True:
@@ -338,23 +338,34 @@
 
     if stripSysroot:
         while True:
-            try:
-                index = compiler_so.index('-isysroot')
+            indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]
+            if not indices:
+                break
+            index = indices[0]
+            if compiler_so[index] == '-isysroot':
                 # Strip this argument and the next one:
                 del compiler_so[index:index+2]
-            except ValueError:
-                break
+            else:
+                # It's '-isysroot/some/path' in one arg
+                del compiler_so[index:index+1]
 
     # Check if the SDK that is used during compilation actually exists,
     # the universal build requires the usage of a universal SDK and not all
     # users have that installed by default.
     sysroot = None
-    if '-isysroot' in cc_args:
-        idx = cc_args.index('-isysroot')
-        sysroot = cc_args[idx+1]
-    elif '-isysroot' in compiler_so:
-        idx = compiler_so.index('-isysroot')
-        sysroot = compiler_so[idx+1]
+    argvar = cc_args
+    indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')]
+    if not indices:
+        argvar = compiler_so
+        indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]
+
+    for idx in indices:
+        if argvar[idx] == '-isysroot':
+            sysroot = argvar[idx+1]
+            break
+        else:
+            sysroot = argvar[idx][len('-isysroot'):]
+            break
 
     if sysroot and not os.path.isdir(sysroot):
         from distutils import log
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py
index c14d8ca..ab989e5 100644
--- a/Lib/_pydecimal.py
+++ b/Lib/_pydecimal.py
@@ -140,8 +140,11 @@
     # Limits for the C version for compatibility
     'MAX_PREC',  'MAX_EMAX', 'MIN_EMIN', 'MIN_ETINY',
 
-    # C version: compile time choice that enables the thread local context
-    'HAVE_THREADS'
+    # C version: compile time choice that enables the thread local context (deprecated, now always true)
+    'HAVE_THREADS',
+
+    # C version: compile time choice that enables the coroutine local context
+    'HAVE_CONTEXTVAR'
 ]
 
 __xname__ = __name__    # sys.modules lookup (--without-threads)
@@ -172,6 +175,7 @@
 
 # Compatibility with the C version
 HAVE_THREADS = True
+HAVE_CONTEXTVAR = True
 if sys.maxsize == 2**63-1:
     MAX_PREC = 999999999999999999
     MAX_EMAX = 999999999999999999
diff --git a/Lib/ast.py b/Lib/ast.py
index b45f1e4..0c88bcf 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -59,11 +59,12 @@
         node_or_string = parse(node_or_string, mode='eval')
     if isinstance(node_or_string, Expression):
         node_or_string = node_or_string.body
+    def _raise_malformed_node(node):
+        raise ValueError(f'malformed node or string: {node!r}')
     def _convert_num(node):
-        if isinstance(node, Constant):
-            if type(node.value) in (int, float, complex):
-                return node.value
-        raise ValueError('malformed node or string: ' + repr(node))
+        if not isinstance(node, Constant) or type(node.value) not in (int, float, complex):
+            _raise_malformed_node(node)
+        return node.value
     def _convert_signed_num(node):
         if isinstance(node, UnaryOp) and isinstance(node.op, (UAdd, USub)):
             operand = _convert_num(node.operand)
@@ -82,6 +83,8 @@
         elif isinstance(node, Set):
             return set(map(_convert, node.elts))
         elif isinstance(node, Dict):
+            if len(node.keys) != len(node.values):
+                _raise_malformed_node(node)
             return dict(zip(map(_convert, node.keys),
                             map(_convert, node.values)))
         elif isinstance(node, BinOp) and isinstance(node.op, (Add, Sub)):
@@ -408,11 +411,11 @@
        class RewriteName(NodeTransformer):
 
            def visit_Name(self, node):
-               return copy_location(Subscript(
+               return Subscript(
                    value=Name(id='data', ctx=Load()),
                    slice=Index(value=Str(s=node.id)),
                    ctx=node.ctx
-               ), node)
+               )
 
     Keep in mind that if the node you're operating on has child nodes you must
     either transform the child nodes yourself or call the :meth:`generic_visit`
diff --git a/Lib/asyncio/base_tasks.py b/Lib/asyncio/base_tasks.py
index e2da462..09bb171 100644
--- a/Lib/asyncio/base_tasks.py
+++ b/Lib/asyncio/base_tasks.py
@@ -24,11 +24,18 @@
 
 def _task_get_stack(task, limit):
     frames = []
-    try:
-        # 'async def' coroutines
+    if hasattr(task._coro, 'cr_frame'):
+        # case 1: 'async def' coroutines
         f = task._coro.cr_frame
-    except AttributeError:
+    elif hasattr(task._coro, 'gi_frame'):
+        # case 2: legacy coroutines
         f = task._coro.gi_frame
+    elif hasattr(task._coro, 'ag_frame'):
+        # case 3: async generators
+        f = task._coro.ag_frame
+    else:
+        # case 4: unknown objects
+        f = None
     if f is not None:
         while f is not None:
             if limit is not None:
diff --git a/Lib/codecs.py b/Lib/codecs.py
index 21c45a7..7f23e97 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -905,11 +905,16 @@
     file = builtins.open(filename, mode, buffering)
     if encoding is None:
         return file
-    info = lookup(encoding)
-    srw = StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
-    # Add attributes to simplify introspection
-    srw.encoding = encoding
-    return srw
+
+    try:
+        info = lookup(encoding)
+        srw = StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
+        # Add attributes to simplify introspection
+        srw.encoding = encoding
+        return srw
+    except:
+        file.close()
+        raise
 
 def EncodedFile(file, data_encoding, file_encoding=None, errors='strict'):
 
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index cadf1c7..a78a47c 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -695,6 +695,13 @@
     #
     # To strip negative and zero counts, add-in an empty counter:
     #       c += Counter()
+    #
+    # Rich comparison operators for multiset subset and superset tests
+    # are deliberately omitted due to semantic conflicts with the
+    # existing inherited dict equality method.  Subset and superset
+    # semantics ignore zero counts and require that p≤q ∧ p≥q → p=q;
+    # however, that would not be the case for p=Counter(a=1, b=0)
+    # and q=Counter(a=1) where the dictionaries are not equal.
 
     def __add__(self, other):
         '''Add counts from two counters.
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 49306d9..bfac8ef 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -41,7 +41,7 @@
         else:
             dfile = None
         if not os.path.isdir(fullname):
-            yield fullname
+            yield fullname, ddir
         elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
               os.path.isdir(fullname) and not os.path.islink(fullname)):
             yield from _walk_dir(fullname, ddir=dfile,
@@ -76,28 +76,33 @@
             from concurrent.futures import ProcessPoolExecutor
         except ImportError:
             workers = 1
-    files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
-                      ddir=ddir)
+    files_and_ddirs = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
+                                ddir=ddir)
     success = True
     if workers != 1 and ProcessPoolExecutor is not None:
         # If workers == 0, let ProcessPoolExecutor choose
         workers = workers or None
         with ProcessPoolExecutor(max_workers=workers) as executor:
-            results = executor.map(partial(compile_file,
-                                           ddir=ddir, force=force,
-                                           rx=rx, quiet=quiet,
-                                           legacy=legacy,
-                                           optimize=optimize,
-                                           invalidation_mode=invalidation_mode),
-                                   files)
+            results = executor.map(
+                    partial(_compile_file_tuple,
+                            force=force, rx=rx, quiet=quiet,
+                            legacy=legacy, optimize=optimize,
+                            invalidation_mode=invalidation_mode,
+                        ),
+                    files_and_ddirs)
             success = min(results, default=True)
     else:
-        for file in files:
-            if not compile_file(file, ddir, force, rx, quiet,
+        for file, dfile in files_and_ddirs:
+            if not compile_file(file, dfile, force, rx, quiet,
                                 legacy, optimize, invalidation_mode):
                 success = False
     return success
 
+def _compile_file_tuple(file_and_dfile, **kwargs):
+    """Needs to be toplevel for ProcessPoolExecutor."""
+    file, dfile = file_and_dfile
+    return compile_file(file, dfile, **kwargs)
+
 def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
                  legacy=False, optimize=-1,
                  invalidation_mode=None):
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py
index 9b97d80..a62044e 100644
--- a/Lib/ctypes/test/test_loading.py
+++ b/Lib/ctypes/test/test_loading.py
@@ -158,8 +158,11 @@
             # Relative path (but not just filename) should succeed
             should_pass("WinDLL('./_sqlite3.dll')")
 
-            # Insecure load flags should succeed
-            should_pass("WinDLL('_sqlite3.dll', winmode=0)")
+            # XXX: This test has started failing on Azure Pipelines CI.  See
+            #      bpo-40214 for more information.
+            if 0:
+                # Insecure load flags should succeed
+                should_pass("WinDLL('_sqlite3.dll', winmode=0)")
 
             # Full path load without DLL_LOAD_DIR shouldn't find dependency
             should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +
diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py
index e8e4b71..03a5986 100644
--- a/Lib/distutils/_msvccompiler.py
+++ b/Lib/distutils/_msvccompiler.py
@@ -97,28 +97,11 @@
 }
 
 def _find_vcvarsall(plat_spec):
+    # bpo-38597: Removed vcruntime return value
     _, best_dir = _find_vc2017()
-    vcruntime = None
-
-    if plat_spec in PLAT_SPEC_TO_RUNTIME:
-        vcruntime_plat = PLAT_SPEC_TO_RUNTIME[plat_spec]
-    else:
-        vcruntime_plat = 'x64' if 'amd64' in plat_spec else 'x86'
-
-    if best_dir:
-        vcredist = os.path.join(best_dir, "..", "..", "redist", "MSVC", "**",
-            vcruntime_plat, "Microsoft.VC14*.CRT", "vcruntime140.dll")
-        try:
-            import glob
-            vcruntime = glob.glob(vcredist, recursive=True)[-1]
-        except (ImportError, OSError, LookupError):
-            vcruntime = None
 
     if not best_dir:
         best_version, best_dir = _find_vc2015()
-        if best_version:
-            vcruntime = os.path.join(best_dir, 'redist', vcruntime_plat,
-                "Microsoft.VC140.CRT", "vcruntime140.dll")
 
     if not best_dir:
         log.debug("No suitable Visual C++ version found")
@@ -129,11 +112,7 @@
         log.debug("%s cannot be found", vcvarsall)
         return None, None
 
-    if not vcruntime or not os.path.isfile(vcruntime):
-        log.debug("%s cannot be found", vcruntime)
-        vcruntime = None
-
-    return vcvarsall, vcruntime
+    return vcvarsall, None
 
 def _get_vc_env(plat_spec):
     if os.getenv("DISTUTILS_USE_SDK"):
@@ -142,7 +121,7 @@
             for key, value in os.environ.items()
         }
 
-    vcvarsall, vcruntime = _find_vcvarsall(plat_spec)
+    vcvarsall, _ = _find_vcvarsall(plat_spec)
     if not vcvarsall:
         raise DistutilsPlatformError("Unable to find vcvarsall.bat")
 
@@ -163,8 +142,6 @@
         if key and value
     }
 
-    if vcruntime:
-        env['py_vcruntime_redist'] = vcruntime
     return env
 
 def _find_exe(exe, paths=None):
@@ -194,12 +171,6 @@
     'win-arm64' : 'x86_arm64'
 }
 
-# A set containing the DLLs that are guaranteed to be available for
-# all micro versions of this Python version. Known extension
-# dependencies that are not in this set will be copied to the output
-# path.
-_BUNDLED_DLLS = frozenset(['vcruntime140.dll'])
-
 class MSVCCompiler(CCompiler) :
     """Concrete class that implements an interface to Microsoft Visual C++,
        as defined by the CCompiler abstract class."""
@@ -263,7 +234,6 @@
         self.rc = _find_exe("rc.exe", paths)   # resource compiler
         self.mc = _find_exe("mc.exe", paths)   # message compiler
         self.mt = _find_exe("mt.exe", paths)   # message compiler
-        self._vcruntime_redist = vc_env.get('py_vcruntime_redist', '')
 
         for dir in vc_env.get('include', '').split(os.pathsep):
             if dir:
@@ -274,13 +244,12 @@
                 self.add_library_dir(dir.rstrip(os.sep))
 
         self.preprocess_options = None
-        # If vcruntime_redist is available, link against it dynamically. Otherwise,
-        # use /MT[d] to build statically, then switch from libucrt[d].lib to ucrt[d].lib
-        # later to dynamically link to ucrtbase but not vcruntime.
+        # bpo-38597: Always compile with dynamic linking
+        # Future releases of Python 3.x will include all past
+        # versions of vcruntime*.dll for compatibility.
         self.compile_options = [
-            '/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG'
+            '/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG', '/MD'
         ]
-        self.compile_options.append('/MD' if self._vcruntime_redist else '/MT')
 
         self.compile_options_debug = [
             '/nologo', '/Od', '/MDd', '/Zi', '/W3', '/D_DEBUG'
@@ -289,8 +258,6 @@
         ldflags = [
             '/nologo', '/INCREMENTAL:NO', '/LTCG'
         ]
-        if not self._vcruntime_redist:
-            ldflags.extend(('/nodefaultlib:libucrt.lib', 'ucrt.lib'))
 
         ldflags_debug = [
             '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
@@ -532,24 +499,11 @@
             try:
                 log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
                 self.spawn([self.linker] + ld_args)
-                self._copy_vcruntime(output_dir)
             except DistutilsExecError as msg:
                 raise LinkError(msg)
         else:
             log.debug("skipping %s (up-to-date)", output_filename)
 
-    def _copy_vcruntime(self, output_dir):
-        vcruntime = self._vcruntime_redist
-        if not vcruntime or not os.path.isfile(vcruntime):
-            return
-
-        if os.path.basename(vcruntime).lower() in _BUNDLED_DLLS:
-            return
-
-        log.debug('Copying "%s"', vcruntime)
-        vcruntime = shutil.copy(vcruntime, output_dir)
-        os.chmod(vcruntime, stat.S_IWRITE)
-
     def spawn(self, cmd):
         old_path = os.getenv('path')
         try:
diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py
index b735fd3..8bd2c94 100644
--- a/Lib/distutils/tests/test_config_cmd.py
+++ b/Lib/distutils/tests/test_config_cmd.py
@@ -47,8 +47,7 @@
         cmd = config(dist)
         cmd._check_compiler()
         compiler = cmd.compiler
-        is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac")
-        if is_xlc:
+        if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower():
             self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options')
 
         # simple pattern searches
diff --git a/Lib/distutils/tests/test_msvccompiler.py b/Lib/distutils/tests/test_msvccompiler.py
index 70a9c93..b518d6a 100644
--- a/Lib/distutils/tests/test_msvccompiler.py
+++ b/Lib/distutils/tests/test_msvccompiler.py
@@ -32,57 +32,6 @@
         finally:
             _msvccompiler._find_vcvarsall = old_find_vcvarsall
 
-    def test_compiler_options(self):
-        import distutils._msvccompiler as _msvccompiler
-        # suppress path to vcruntime from _find_vcvarsall to
-        # check that /MT is added to compile options
-        old_find_vcvarsall = _msvccompiler._find_vcvarsall
-        def _find_vcvarsall(plat_spec):
-            return old_find_vcvarsall(plat_spec)[0], None
-        _msvccompiler._find_vcvarsall = _find_vcvarsall
-        try:
-            compiler = _msvccompiler.MSVCCompiler()
-            compiler.initialize()
-
-            self.assertIn('/MT', compiler.compile_options)
-            self.assertNotIn('/MD', compiler.compile_options)
-        finally:
-            _msvccompiler._find_vcvarsall = old_find_vcvarsall
-
-    def test_vcruntime_copy(self):
-        import distutils._msvccompiler as _msvccompiler
-        # force path to a known file - it doesn't matter
-        # what we copy as long as its name is not in
-        # _msvccompiler._BUNDLED_DLLS
-        old_find_vcvarsall = _msvccompiler._find_vcvarsall
-        def _find_vcvarsall(plat_spec):
-            return old_find_vcvarsall(plat_spec)[0], __file__
-        _msvccompiler._find_vcvarsall = _find_vcvarsall
-        try:
-            tempdir = self.mkdtemp()
-            compiler = _msvccompiler.MSVCCompiler()
-            compiler.initialize()
-            compiler._copy_vcruntime(tempdir)
-
-            self.assertTrue(os.path.isfile(os.path.join(
-                tempdir, os.path.basename(__file__))))
-        finally:
-            _msvccompiler._find_vcvarsall = old_find_vcvarsall
-
-    def test_vcruntime_skip_copy(self):
-        import distutils._msvccompiler as _msvccompiler
-
-        tempdir = self.mkdtemp()
-        compiler = _msvccompiler.MSVCCompiler()
-        compiler.initialize()
-        dll = compiler._vcruntime_redist
-        self.assertTrue(os.path.isfile(dll), dll or "<None>")
-
-        compiler._copy_vcruntime(tempdir)
-
-        self.assertFalse(os.path.isfile(os.path.join(
-            tempdir, os.path.basename(dll))), dll or "<None>")
-
     def test_get_vc_env_unicode(self):
         import distutils._msvccompiler as _msvccompiler
 
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index d10a78d..4d7a6de 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -288,7 +288,7 @@
             # vs
             #   /usr/lib/libedit.dylib
             cflags = sysconfig.get_config_var('CFLAGS')
-            m = re.search(r'-isysroot\s+(\S+)', cflags)
+            m = re.search(r'-isysroot\s*(\S+)', cflags)
             if m is None:
                 sysroot = '/'
             else:
diff --git a/Lib/doctest.py b/Lib/doctest.py
index dcbcfe5..ee71984 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -211,6 +211,13 @@
     else:
         raise TypeError("Expected a module, string, or None")
 
+def _newline_convert(data):
+    # We have two cases to cover and we need to make sure we do
+    # them in the right order
+    for newline in ('\r\n', '\r'):
+        data = data.replace(newline, '\n')
+    return data
+
 def _load_testfile(filename, package, module_relative, encoding):
     if module_relative:
         package = _normalize_module(package, 3)
@@ -221,7 +228,7 @@
                 file_contents = file_contents.decode(encoding)
                 # get_data() opens files as 'rb', so one must do the equivalent
                 # conversion as universal newlines would do.
-                return file_contents.replace(os.linesep, '\n'), filename
+                return _newline_convert(file_contents), filename
     with open(filename, encoding=encoding) as f:
         return f.read(), filename
 
diff --git a/Lib/encodings/punycode.py b/Lib/encodings/punycode.py
index 66c5101..1c57264 100644
--- a/Lib/encodings/punycode.py
+++ b/Lib/encodings/punycode.py
@@ -143,7 +143,7 @@
             digit = char - 22 # 0x30-26
         elif errors == "strict":
             raise UnicodeError("Invalid extended code point '%s'"
-                               % extended[extpos])
+                               % extended[extpos-1])
         else:
             return extpos, None
         t = T(j, bias)
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index fc0edec..566fb2a 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -2,6 +2,7 @@
 import os.path
 import pkgutil
 import sys
+import runpy
 import tempfile
 
 
@@ -23,9 +24,18 @@
     if additional_paths is not None:
         sys.path = additional_paths + sys.path
 
-    # Install the bundled software
-    import pip._internal
-    return pip._internal.main(args)
+    # Invoke pip as if it's the main module, and catch the exit.
+    backup_argv = sys.argv[:]
+    sys.argv[1:] = args
+    try:
+        # run_module() alters sys.modules and sys.argv, but restores them at exit
+        runpy.run_module("pip", run_name="__main__", alter_sys=True)
+    except SystemExit as exc:
+        return exc.code
+    finally:
+        sys.argv[:] = backup_argv
+
+    raise SystemError("pip did not exit, this should never happen")
 
 
 def version():
diff --git a/Lib/functools.py b/Lib/functools.py
index b41dea7..4cde5f5 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -11,7 +11,8 @@
 
 __all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
            'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial',
-           'partialmethod', 'singledispatch', 'singledispatchmethod']
+           'partialmethod', 'singledispatch', 'singledispatchmethod',
+           "cached_property"]
 
 from abc import get_cache_token
 from collections import namedtuple
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 33a4347..019380a 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -828,6 +828,8 @@
 
         (self.host, self.port) = self._get_hostport(host, port)
 
+        self._validate_host(self.host)
+
         # This is stored as an instance variable to allow unit
         # tests to replace it with a suitable mockup
         self._create_connection = socket.create_connection
@@ -1183,6 +1185,14 @@
             raise InvalidURL(f"URL can't contain control characters. {url!r} "
                              f"(found at least {match.group()!r})")
 
+    def _validate_host(self, host):
+        """Validate a host so it doesn't contain control characters."""
+        # Prevent CVE-2019-18348.
+        match = _contains_disallowed_url_pchar_re.search(host)
+        if match:
+            raise InvalidURL(f"URL can't contain control characters. {host!r} "
+                             f"(found at least {match.group()!r})")
+
     def putheader(self, header, *values):
         """Send a request header line to the server.
 
diff --git a/Lib/idlelib/Icons/README.txt b/Lib/idlelib/Icons/README.txt
new file mode 100644
index 0000000..8b47162
--- /dev/null
+++ b/Lib/idlelib/Icons/README.txt
@@ -0,0 +1,9 @@
+The IDLE icons are from https://bugs.python.org/issue1490384
+
+Created by Andrew Clover.
+
+The original sources are available from Andrew's website:
+https://www.doxdesk.com/software/py/pyicons.html
+
+Various different formats and sizes are available at this GitHub Pull Request:
+https://github.com/python/cpython/pull/17473
diff --git a/Lib/idlelib/Icons/idle.icns b/Lib/idlelib/Icons/idle.icns
deleted file mode 100644
index f65e313..0000000
--- a/Lib/idlelib/Icons/idle.icns
+++ /dev/null
Binary files differ
diff --git a/Lib/idlelib/Icons/idle_256.png b/Lib/idlelib/Icons/idle_256.png
new file mode 100644
index 0000000..99ffa6f
--- /dev/null
+++ b/Lib/idlelib/Icons/idle_256.png
Binary files differ
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index fe1706e..de7543e 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -3,6 +3,20 @@
 ======================================
 
 
+bpo-38689: IDLE will no longer freeze when inspect.signature fails
+when fetching a calltip.
+
+bpo-27115: For 'Go to Line', use a Query entry box subclass with
+IDLE standard behavior and improved error checking.
+
+bpo-39885: Since clicking to get an IDLE context menu moves the
+cursor, any text selection should be and now is cleared.
+
+bpo-39852: Edit "Go to line" now clears any selection, preventing
+accidental deletion.  It also updates Ln and Col on the status bar.
+
+bpo-39781: Selecting code context lines no longer causes a jump.
+
 bpo-39663: Add tests for pyparse find_good_parse_start().
 
 bpo-39600: Remove duplicate font names from configuration list.
diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py
index 0643c09..fe7a6be 100644
--- a/Lib/idlelib/autocomplete_w.py
+++ b/Lib/idlelib/autocomplete_w.py
@@ -4,7 +4,7 @@
 import platform
 
 from tkinter import *
-from tkinter.ttk import Frame, Scrollbar
+from tkinter.ttk import Scrollbar
 
 from idlelib.autocomplete import FILES, ATTRS
 from idlelib.multicall import MC_SHIFT
diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py
index 2e0db60..d4092c7 100644
--- a/Lib/idlelib/calltip.py
+++ b/Lib/idlelib/calltip.py
@@ -129,20 +129,22 @@
     empty line or _MAX_LINES.    For builtins, this typically includes
     the arguments in addition to the return value.
     '''
-    argspec = default = ""
+    # Determine function object fob to inspect.
     try:
         ob_call = ob.__call__
-    except BaseException:
-        return default
-
+    except BaseException:  # Buggy user object could raise anything.
+        return ''  # No popup for non-callables.
     fob = ob_call if isinstance(ob_call, types.MethodType) else ob
 
+    # Initialize argspec and wrap it to get lines.
     try:
         argspec = str(inspect.signature(fob))
-    except ValueError as err:
+    except Exception as err:
         msg = str(err)
         if msg.startswith(_invalid_method):
             return _invalid_method
+        else:
+            argspec = ''
 
     if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional):
         # Add explanation TODO remove after 3.7, before 3.9.
@@ -154,6 +156,7 @@
     lines = (textwrap.wrap(argspec, _MAX_COLS, subsequent_indent=_INDENT)
              if len(argspec) > _MAX_COLS else [argspec] if argspec else [])
 
+    # Augment lines from docstring, if any, and join to get argspec.
     if isinstance(ob_call, types.MethodType):
         doc = ob_call.__doc__
     else:
@@ -167,9 +170,8 @@
                 line = line[: _MAX_COLS - 3] + '...'
             lines.append(line)
     argspec = '\n'.join(lines)
-    if not argspec:
-        argspec = _default_callable_argspec
-    return argspec
+
+    return argspec or _default_callable_argspec
 
 
 if __name__ == '__main__':
diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py
index 4ce9813..989b30e 100644
--- a/Lib/idlelib/codecontext.py
+++ b/Lib/idlelib/codecontext.py
@@ -7,7 +7,6 @@
 enclosing block.  The number of hint lines is determined by the maxlines
 variable in the codecontext section of config-extensions.def. Lines which do
 not open blocks are not shown in the context hints pane.
-
 """
 import re
 from sys import maxsize as INFINITY
@@ -17,8 +16,8 @@
 
 from idlelib.config import idleConf
 
-BLOCKOPENERS = {"class", "def", "elif", "else", "except", "finally", "for",
-                "if", "try", "while", "with", "async"}
+BLOCKOPENERS = {'class', 'def', 'if', 'elif', 'else', 'while', 'for',
+                 'try', 'except', 'finally', 'with', 'async'}
 
 
 def get_spaces_firstword(codeline, c=re.compile(r"^(\s*)(\w*)")):
@@ -84,7 +83,7 @@
         if self.t1 is not None:
             try:
                 self.text.after_cancel(self.t1)
-            except tkinter.TclError:
+            except tkinter.TclError:  # pragma: no cover
                 pass
             self.t1 = None
 
@@ -112,7 +111,7 @@
                 padx += widget.tk.getint(info['padx'])
                 padx += widget.tk.getint(widget.cget('padx'))
                 border += widget.tk.getint(widget.cget('border'))
-            self.context = tkinter.Text(
+            context = self.context = tkinter.Text(
                 self.editwin.text_frame,
                 height=1,
                 width=1,  # Don't request more than we get.
@@ -120,11 +119,11 @@
                 padx=padx, border=border, relief=SUNKEN, state='disabled')
             self.update_font()
             self.update_highlight_colors()
-            self.context.bind('<ButtonRelease-1>', self.jumptoline)
+            context.bind('<ButtonRelease-1>', self.jumptoline)
             # Get the current context and initiate the recurring update event.
             self.timer_event()
             # Grid the context widget above the text widget.
-            self.context.grid(row=0, column=1, sticky=NSEW)
+            context.grid(row=0, column=1, sticky=NSEW)
 
             line_number_colors = idleConf.GetHighlight(idleConf.CurrentTheme(),
                                                        'linenumber')
@@ -215,18 +214,25 @@
         self.context['state'] = 'disabled'
 
     def jumptoline(self, event=None):
-        "Show clicked context line at top of editor."
-        lines = len(self.info)
-        if lines == 1:  # No context lines are showing.
-            newtop = 1
-        else:
-            # Line number clicked.
-            contextline = int(float(self.context.index('insert')))
-            # Lines not displayed due to maxlines.
-            offset = max(1, lines - self.context_depth) - 1
-            newtop = self.info[offset + contextline][0]
-        self.text.yview(f'{newtop}.0')
-        self.update_code_context()
+        """ Show clicked context line at top of editor.
+
+        If a selection was made, don't jump; allow copying.
+        If no visible context, show the top line of the file.
+        """
+        try:
+            self.context.index("sel.first")
+        except tkinter.TclError:
+            lines = len(self.info)
+            if lines == 1:  # No context lines are showing.
+                newtop = 1
+            else:
+                # Line number clicked.
+                contextline = int(float(self.context.index('insert')))
+                # Lines not displayed due to maxlines.
+                offset = max(1, lines - self.context_depth) - 1
+                newtop = self.info[offset + contextline][0]
+            self.text.yview(f'{newtop}.0')
+            self.update_code_context()
 
     def timer_event(self):
         "Event on editor text widget triggered every UPDATEINTERVAL ms."
diff --git a/Lib/idlelib/config_key.py b/Lib/idlelib/config_key.py
index 4478323..7510aa9 100644
--- a/Lib/idlelib/config_key.py
+++ b/Lib/idlelib/config_key.py
@@ -1,7 +1,7 @@
 """
 Dialog for building Tkinter accelerator key bindings
 """
-from tkinter import Toplevel, Listbox, Text, StringVar, TclError
+from tkinter import Toplevel, Listbox, StringVar, TclError
 from tkinter.ttk import Frame, Button, Checkbutton, Entry, Label, Scrollbar
 from tkinter import messagebox
 import string
diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py
index 9d5c2cd..8259649 100644
--- a/Lib/idlelib/configdialog.py
+++ b/Lib/idlelib/configdialog.py
@@ -11,7 +11,7 @@
 """
 import re
 
-from tkinter import (Toplevel, Listbox, Text, Scale, Canvas,
+from tkinter import (Toplevel, Listbox, Scale, Canvas,
                      StringVar, BooleanVar, IntVar, TRUE, FALSE,
                      TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE,
                      NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW,
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index 04c786d..b0f88b5 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -499,6 +499,7 @@
     rmenu = None
 
     def right_menu_event(self, event):
+        self.text.tag_remove("sel", "1.0", "end")
         self.text.mark_set("insert", "@%d,%d" % (event.x, event.y))
         if not self.rmenu:
             self.make_rmenu()
@@ -671,15 +672,16 @@
 
     def goto_line_event(self, event):
         text = self.text
-        lineno = tkSimpleDialog.askinteger("Goto",
-                "Go to line number:",parent=text)
-        if lineno is None:
-            return "break"
-        if lineno <= 0:
-            text.bell()
-            return "break"
-        text.mark_set("insert", "%d.0" % lineno)
-        text.see("insert")
+        lineno = query.Goto(
+                text, "Go To Line",
+                "Enter a positive integer\n"
+                "('big' = end of file):"
+                ).result
+        if lineno is not None:
+            text.tag_remove("sel", "1.0", "end")
+            text.mark_set("insert", f'{lineno}.0')
+            text.see("insert")
+            self.set_line_and_column()
         return "break"
 
     def open_module(self):
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
index 0b2bdd2..424c6b5 100644
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <meta charset="utf-8" />
-    <title>IDLE &#8212; Python 3.9.0a1 documentation</title>
+    <title>IDLE &#8212; Python 3.9.0a4 documentation</title>
     <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
@@ -17,7 +17,7 @@
     <script type="text/javascript" src="../_static/sidebar.js"></script>
 
     <link rel="search" type="application/opensearchdescription+xml"
-          title="Search within Python 3.9.0a1 documentation"
+          title="Search within Python 3.9.0a4 documentation"
           href="../_static/opensearch.xml"/>
     <link rel="author" title="About these documents" href="../about.html" />
     <link rel="index" title="Index" href="../genindex.html" />
@@ -71,7 +71,7 @@
 
 
     <li>
-      <a href="../index.html">3.9.0a1 Documentation</a> &#187;
+      <a href="../index.html">3.9.0a4 Documentation</a> &#187;
     </li>
 
           <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
@@ -197,7 +197,9 @@
 </dd>
 <dt>Replace…</dt><dd><p>Open a search-and-replace dialog.</p>
 </dd>
-<dt>Go to Line</dt><dd><p>Move cursor to the line number requested and make that line visible.</p>
+<dt>Go to Line</dt><dd><p>Move the cursor to the beginning of the line requested and make that
+line visible.  A request past the end of the file goes to the end.
+Clear any selection and update the line and column status.</p>
 </dd>
 <dt>Show Completions</dt><dd><p>Open a scrollable list allowing selection of keywords and attributes. See
 <a class="reference internal" href="#completions"><span class="std std-ref">Completions</span></a> in the Editing and navigation section below.</p>
@@ -635,17 +637,20 @@
 clash, or cannot or does not want to run as admin, it might be easiest to
 completely remove Python and start over.</p>
 <p>A zombie pythonw.exe process could be a problem.  On Windows, use Task
-Manager to detect and stop one.  Sometimes a restart initiated by a program
-crash or Keyboard Interrupt (control-C) may fail to connect.  Dismissing
-the error box or Restart Shell on the Shell menu may fix a temporary problem.</p>
+Manager to check for one and stop it if there is.  Sometimes a restart
+initiated by a program crash or Keyboard Interrupt (control-C) may fail
+to connect.  Dismissing the error box or using Restart Shell on the Shell
+menu may fix a temporary problem.</p>
 <p>When IDLE first starts, it attempts to read user configuration files in
 <code class="docutils literal notranslate"><span class="pre">~/.idlerc/</span></code> (~ is one’s home directory).  If there is a problem, an error
 message should be displayed.  Leaving aside random disk glitches, this can
-be prevented by never editing the files by hand, using the configuration
-dialog, under Options, instead Options.  Once it happens, the solution may
-be to delete one or more of the configuration files.</p>
+be prevented by never editing the files by hand.  Instead, use the
+configuration dialog, under Options.  Once there is an error in a user
+configuration file, the best solution may be to delete it and start over
+with the settings dialog.</p>
 <p>If IDLE quits with no message, and it was not started from a console, try
-starting from a console (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if a message appears.</p>
+starting it from a console or terminal (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if
+this results in an error message.</p>
 </div>
 <div class="section" id="running-user-code">
 <h3>Running user code<a class="headerlink" href="#running-user-code" title="Permalink to this headline">¶</a></h3>
@@ -930,7 +935,7 @@
 
 
     <li>
-      <a href="../index.html">3.9.0a1 Documentation</a> &#187;
+      <a href="../index.html">3.9.0a4 Documentation</a> &#187;
     </li>
 
           <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
@@ -953,7 +958,7 @@
       </ul>
     </div>
     <div class="footer">
-    &copy; <a href="../copyright.html">Copyright</a> 2001-2019, Python Software Foundation.
+    &copy; <a href="../copyright.html">Copyright</a> 2001-2020, Python Software Foundation.
     <br />
 
     The Python Software Foundation is a non-profit corporation.
@@ -961,7 +966,7 @@
 <br />
     <br />
 
-    Last updated on Nov 24, 2019.
+    Last updated on Mar 07, 2020.
     <a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
     <br />
 
diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py
index 886959b..d386b5c 100644
--- a/Lib/idlelib/idle_test/test_calltip.py
+++ b/Lib/idlelib/idle_test/test_calltip.py
@@ -219,20 +219,30 @@
             with self.subTest(meth=meth, mtip=mtip):
                 self.assertEqual(get_spec(meth), mtip)
 
-    def test_attribute_exception(self):
+    def test_buggy_getattr_class(self):
         class NoCall:
-            def __getattr__(self, name):
-                raise BaseException
+            def __getattr__(self, name):  # Not invoked for class attribute.
+                raise IndexError  # Bug.
         class CallA(NoCall):
-            def __call__(oui, a, b, c):
+            def __call__(self, ci):  # Bug does not matter.
                 pass
         class CallB(NoCall):
-            def __call__(self, ci):
+            def __call__(oui, a, b, c):  # Non-standard 'self'.
                 pass
 
         for meth, mtip  in ((NoCall, default_tip), (CallA, default_tip),
-                            (NoCall(), ''), (CallA(), '(a, b, c)'),
-                            (CallB(), '(ci)')):
+                            (NoCall(), ''), (CallA(), '(ci)'),
+                            (CallB(), '(a, b, c)')):
+            with self.subTest(meth=meth, mtip=mtip):
+                self.assertEqual(get_spec(meth), mtip)
+
+    def test_metaclass_class(self):  # Failure case for issue 38689.
+        class Type(type):  # Type() requires 3 type args, returns class.
+            __class__ = property({}.__getitem__, {}.__setitem__)
+        class Object(metaclass=Type):
+            __slots__ = '__class__'
+        for meth, mtip  in ((Type, default_tip), (Object, default_tip),
+                            (Object(), '')):
             with self.subTest(meth=meth, mtip=mtip):
                 self.assertEqual(get_spec(meth), mtip)
 
diff --git a/Lib/idlelib/idle_test/test_codecontext.py b/Lib/idlelib/idle_test/test_codecontext.py
index 3ec49e9..9578cc73 100644
--- a/Lib/idlelib/idle_test/test_codecontext.py
+++ b/Lib/idlelib/idle_test/test_codecontext.py
@@ -332,6 +332,14 @@
         jump()
         eq(cc.topvisible, 8)
 
+        # Context selection stops jump.
+        cc.text.yview('5.0')
+        cc.update_code_context()
+        cc.context.tag_add('sel', '1.0', '2.0')
+        cc.context.mark_set('insert', '1.0')
+        jump()  # Without selection, to line 2.
+        eq(cc.topvisible, 5)
+
     @mock.patch.object(codecontext.CodeContext, 'update_code_context')
     def test_timer_event(self, mock_update):
         # Ensure code context is not active.
diff --git a/Lib/idlelib/idle_test/test_query.py b/Lib/idlelib/idle_test/test_query.py
index f957585..6d026cb 100644
--- a/Lib/idlelib/idle_test/test_query.py
+++ b/Lib/idlelib/idle_test/test_query.py
@@ -138,6 +138,33 @@
         self.assertEqual(dialog.entry_error['text'], '')
 
 
+class GotoTest(unittest.TestCase):
+    "Test Goto subclass of Query."
+
+    class Dummy_ModuleName:
+        entry_ok = query.Goto.entry_ok  # Function being tested.
+        def __init__(self, dummy_entry):
+            self.entry = Var(value=dummy_entry)
+            self.entry_error = {'text': ''}
+        def showerror(self, message):
+            self.entry_error['text'] = message
+
+    def test_bogus_goto(self):
+        dialog = self.Dummy_ModuleName('a')
+        self.assertEqual(dialog.entry_ok(), None)
+        self.assertIn('not a base 10 integer', dialog.entry_error['text'])
+
+    def test_bad_goto(self):
+        dialog = self.Dummy_ModuleName('0')
+        self.assertEqual(dialog.entry_ok(), None)
+        self.assertIn('not a positive integer', dialog.entry_error['text'])
+
+    def test_good_goto(self):
+        dialog = self.Dummy_ModuleName('1')
+        self.assertEqual(dialog.entry_ok(), 1)
+        self.assertEqual(dialog.entry_error['text'], '')
+
+
 # 3 HelpSource test classes each test one method.
 
 class HelpsourceBrowsefileTest(unittest.TestCase):
@@ -363,6 +390,22 @@
         root.destroy()
 
 
+class GotoGuiTest(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        requires('gui')
+
+    def test_click_module_name(self):
+        root = Tk()
+        root.withdraw()
+        dialog =  query.Goto(root, 'T', 't', _utest=True)
+        dialog.entry.insert(0, '22')
+        dialog.button_ok.invoke()
+        self.assertEqual(dialog.result, 22)
+        root.destroy()
+
+
 class HelpsourceGuiTest(unittest.TestCase):
 
     @classmethod
diff --git a/Lib/idlelib/idle_test/test_sidebar.py b/Lib/idlelib/idle_test/test_sidebar.py
index 0f5b4c7..2974a9a 100644
--- a/Lib/idlelib/idle_test/test_sidebar.py
+++ b/Lib/idlelib/idle_test/test_sidebar.py
@@ -1,6 +1,5 @@
 """Test sidebar, coverage 93%"""
 import idlelib.sidebar
-from sys import platform
 from itertools import chain
 import unittest
 import unittest.mock
diff --git a/Lib/idlelib/idle_test/test_squeezer.py b/Lib/idlelib/idle_test/test_squeezer.py
index 1af2ce8..e3912f4 100644
--- a/Lib/idlelib/idle_test/test_squeezer.py
+++ b/Lib/idlelib/idle_test/test_squeezer.py
@@ -1,6 +1,5 @@
 "Test squeezer, coverage 95%"
 
-from collections import namedtuple
 from textwrap import dedent
 from tkinter import Text, Tk
 import unittest
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index d5b310f..66ae0f7 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -16,7 +16,7 @@
 if sys.platform == 'win32':
     try:
         import ctypes
-        PROCESS_SYSTEM_DPI_AWARE = 1
+        PROCESS_SYSTEM_DPI_AWARE = 1  # Int required.
         ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
     except (ImportError, AttributeError, OSError):
         pass
@@ -676,7 +676,6 @@
     def runsource(self, source):
         "Extend base class method: Stuff the source in the line cache first"
         filename = self.stuffsource(source)
-        self.more = 0
         # at the moment, InteractiveInterpreter expects str
         assert isinstance(source, str)
         # InteractiveInterpreter.runsource() calls its runcode() method,
@@ -993,12 +992,12 @@
     def beginexecuting(self):
         "Helper for ModifiedInterpreter"
         self.resetoutput()
-        self.executing = 1
+        self.executing = True
 
     def endexecuting(self):
         "Helper for ModifiedInterpreter"
-        self.executing = 0
-        self.canceled = 0
+        self.executing = False
+        self.canceled = False
         self.showprompt()
 
     def close(self):
@@ -1075,7 +1074,7 @@
     def readline(self):
         save = self.reading
         try:
-            self.reading = 1
+            self.reading = True
             self.top.mainloop()  # nested mainloop()
         finally:
             self.reading = save
@@ -1087,11 +1086,11 @@
             line = "\n"
         self.resetoutput()
         if self.canceled:
-            self.canceled = 0
+            self.canceled = False
             if not use_subprocess:
                 raise KeyboardInterrupt
         if self.endoffile:
-            self.endoffile = 0
+            self.endoffile = False
             line = ""
         return line
 
@@ -1109,8 +1108,8 @@
             self.interp.write("KeyboardInterrupt\n")
             self.showprompt()
             return "break"
-        self.endoffile = 0
-        self.canceled = 1
+        self.endoffile = False
+        self.canceled = True
         if (self.executing and self.interp.rpcclt):
             if self.interp.getdebugger():
                 self.interp.restart_subprocess()
@@ -1130,8 +1129,8 @@
             self.resetoutput()
             self.close()
         else:
-            self.canceled = 0
-            self.endoffile = 1
+            self.canceled = False
+            self.endoffile = True
             self.top.quit()
         return "break"
 
@@ -1303,7 +1302,7 @@
             raise ###pass  # ### 11Aug07 KBK if we are expecting exceptions
                            # let's find out what they are and be specific.
         if self.canceled:
-            self.canceled = 0
+            self.canceled = False
             if not use_subprocess:
                 raise KeyboardInterrupt
         return count
@@ -1486,9 +1485,14 @@
         iconfile = os.path.join(icondir, 'idle.ico')
         root.wm_iconbitmap(default=iconfile)
     elif not macosx.isAquaTk():
-        ext = '.png' if TkVersion >= 8.6 else '.gif'
+        if TkVersion >= 8.6:
+            ext = '.png'
+            sizes = (16, 32, 48, 256)
+        else:
+            ext = '.gif'
+            sizes = (16, 32, 48)
         iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
-                     for size in (16, 32, 48)]
+                     for size in sizes]
         icons = [PhotoImage(master=root, file=iconfile)
                  for iconfile in iconfiles]
         root.wm_iconphoto(True, *icons)
diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py
index 097e6e6..2a88530 100644
--- a/Lib/idlelib/query.py
+++ b/Lib/idlelib/query.py
@@ -108,6 +108,7 @@
                                exists=True, root=self.parent)
         self.entry_error = Label(frame, text=' ', foreground='red',
                                  font=self.error_font)
+        # Display or blank error by setting ['text'] =.
         entrylabel.grid(column=0, row=0, columnspan=3, padx=5, sticky=W)
         self.entry.grid(column=0, row=1, columnspan=3, padx=5, sticky=W+E,
                         pady=[10,0])
@@ -132,7 +133,6 @@
 
     def entry_ok(self):  # Example: usually replace.
         "Return non-blank entry or None."
-        self.entry_error['text'] = ''
         entry = self.entry.get().strip()
         if not entry:
             self.showerror('blank line.')
@@ -144,6 +144,7 @@
 
         Otherwise leave dialog open for user to correct entry or cancel.
         '''
+        self.entry_error['text'] = ''
         entry = self.entry_ok()
         if entry is not None:
             self.result = entry
@@ -173,7 +174,6 @@
 
     def entry_ok(self):
         "Return sensible ConfigParser section name or None."
-        self.entry_error['text'] = ''
         name = self.entry.get().strip()
         if not name:
             self.showerror('no name specified.')
@@ -198,7 +198,6 @@
 
     def entry_ok(self):
         "Return entered module name as file path or None."
-        self.entry_error['text'] = ''
         name = self.entry.get().strip()
         if not name:
             self.showerror('no name specified.')
@@ -224,6 +223,22 @@
         return file_path
 
 
+class Goto(Query):
+    "Get a positive line number for editor Go To Line."
+    # Used in editor.EditorWindow.goto_line_event.
+
+    def entry_ok(self):
+        try:
+            lineno = int(self.entry.get())
+        except ValueError:
+            self.showerror('not a base 10 integer.')
+            return None
+        if lineno <= 0:
+            self.showerror('not a positive integer.')
+            return None
+        return lineno
+
+
 class HelpSource(Query):
     "Get menu name and help source for Help menu."
     # Used in ConfigDialog.HelpListItemAdd/Edit, (941/9)
@@ -311,7 +326,6 @@
 
     def entry_ok(self):
         "Return apparently valid (name, path) or None"
-        self.entry_error['text'] = ''
         self.path_error['text'] = ''
         name = self.item_ok()
         path = self.path_ok()
@@ -362,7 +376,6 @@
 
     def entry_ok(self):
         "Return apparently valid (cli_args, restart) or None"
-        self.entry_error['text'] = ''
         cli_args = self.cli_args_ok()
         restart = self.restartvar.get()
         return None if cli_args is None else (cli_args, restart)
diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py
index 808a2ae..a66c1a4 100644
--- a/Lib/idlelib/textview.py
+++ b/Lib/idlelib/textview.py
@@ -6,7 +6,6 @@
 from tkinter.ttk import Frame, Scrollbar, Button
 from tkinter.messagebox import showerror
 
-from functools import update_wrapper
 from idlelib.colorizer import color_config
 
 
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 3ff395c..e8ea8c2 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -741,7 +741,7 @@
         return sys.modules.get(modulesbyfile[file])
     # Update the filename to module name cache and check yet again
     # Copy sys.modules in order to cope with changes while iterating
-    for modname, module in list(sys.modules.items()):
+    for modname, module in sys.modules.copy().items():
         if ismodule(module) and hasattr(module, '__file__'):
             f = module.__file__
             if f == _filesbymodname.get(modname, None):
diff --git a/Lib/json/tool.py b/Lib/json/tool.py
index 8db9ea4..c42138a 100644
--- a/Lib/json/tool.py
+++ b/Lib/json/tool.py
@@ -52,4 +52,7 @@
 
 
 if __name__ == '__main__':
-    main()
+    try:
+        main()
+    except BrokenPipeError as exc:
+        sys.exit(exc.errno)
diff --git a/Lib/lib2to3/Grammar.txt b/Lib/lib2to3/Grammar.txt
index 68b7386..8ce7fd8 100644
--- a/Lib/lib2to3/Grammar.txt
+++ b/Lib/lib2to3/Grammar.txt
@@ -67,8 +67,8 @@
 
 compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt
 async_stmt: ASYNC (funcdef | with_stmt | for_stmt)
-if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
-while_stmt: 'while' test ':' suite ['else' ':' suite]
+if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite]
+while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite]
 for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
 try_stmt: ('try' ':' suite
            ((except_clause ':' suite)+
@@ -91,6 +91,7 @@
 old_test: or_test | old_lambdef
 old_lambdef: 'lambda' [varargslist] ':' old_test
 
+namedexpr_test: test [':=' test]
 test: or_test ['if' or_test 'else' test] | lambdef
 or_test: and_test ('or' and_test)*
 and_test: not_test ('and' not_test)*
@@ -111,8 +112,8 @@
        '{' [dictsetmaker] '}' |
        '`' testlist1 '`' |
        NAME | NUMBER | STRING+ | '.' '.' '.')
-listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
-testlist_gexp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
+listmaker: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] )
+testlist_gexp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] )
 lambdef: 'lambda' [varargslist] ':' test
 trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
 subscriptlist: subscript (',' subscript)* [',']
@@ -137,6 +138,7 @@
 # multiple (test comp_for) arguments are blocked; keyword unpackings
 # that precede iterable unpackings are blocked; etc.
 argument: ( test [comp_for] |
+            test ':=' test |
             test '=' test |
             '**' test |
 	        '*' test )
diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py
index a1da546..6a4d575 100644
--- a/Lib/lib2to3/pgen2/grammar.py
+++ b/Lib/lib2to3/pgen2/grammar.py
@@ -178,6 +178,7 @@
 // DOUBLESLASH
 //= DOUBLESLASHEQUAL
 -> RARROW
+:= COLONEQUAL
 """
 
 opmap = {}
diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py
index 1a67955..5f6612f 100755
--- a/Lib/lib2to3/pgen2/token.py
+++ b/Lib/lib2to3/pgen2/token.py
@@ -65,7 +65,8 @@
 AWAIT = 56
 ASYNC = 57
 ERRORTOKEN = 58
-N_TOKENS = 59
+COLONEQUAL = 59
+N_TOKENS = 60
 NT_OFFSET = 256
 #--end constants--
 
diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py
index 7924ff3..0e2685d 100644
--- a/Lib/lib2to3/pgen2/tokenize.py
+++ b/Lib/lib2to3/pgen2/tokenize.py
@@ -93,7 +93,7 @@
                  r"~")
 
 Bracket = '[][(){}]'
-Special = group(r'\r?\n', r'[:;.,`@]')
+Special = group(r'\r?\n', r':=', r'[:;.,`@]')
 Funny = group(Operator, Bracket, Special)
 
 PlainToken = group(Number, Funny, String, Name)
diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py
index 868ada7..3a0e7f4 100644
--- a/Lib/lib2to3/tests/test_parser.py
+++ b/Lib/lib2to3/tests/test_parser.py
@@ -629,6 +629,21 @@
         self.validate(s)
 
 
+class TestNamedAssignments(GrammarTest):
+
+    def test_named_assignment_if(self):
+        driver.parse_string("if f := x(): pass\n")
+
+    def test_named_assignment_while(self):
+        driver.parse_string("while f := x(): pass\n")
+
+    def test_named_assignment_generator(self):
+        driver.parse_string("any((lastNum := num) == 1 for num in [1, 2, 3])\n")
+
+    def test_named_assignment_listcomp(self):
+        driver.parse_string("[(lastNum := num) == 1 for num in [1, 2, 3]]\n")
+
+
 class TestPickleableException(unittest.TestCase):
     def test_ParseError(self):
         err = ParseError('msg', 2, None, (1, 'context'))
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index e0d2998..aadcd23 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -5,6 +5,7 @@
 import importlib.machinery
 import marshal
 import os
+import io
 import sys
 import types
 import warnings
@@ -80,23 +81,20 @@
 
     if isinstance(spec.loader, importlib.machinery.SourceFileLoader):
         kind = _PY_SOURCE
-        mode = "r"
 
     elif isinstance(spec.loader, importlib.machinery.ExtensionFileLoader):
         kind = _C_EXTENSION
-        mode = "rb"
 
     elif isinstance(spec.loader, importlib.machinery.SourcelessFileLoader):
         kind = _PY_COMPILED
-        mode = "rb"
 
     else:  # Should never happen.
         return None, None, ("", "", _SEARCH_ERROR)
 
-    file = open(file_path, mode)
+    file = io.open_code(file_path)
     suffix = os.path.splitext(file_path)[-1]
 
-    return file, file_path, (suffix, mode, kind)
+    return file, file_path, (suffix, "rb", kind)
 
 
 class Module:
@@ -160,15 +158,15 @@
 
     def run_script(self, pathname):
         self.msg(2, "run_script", pathname)
-        with open(pathname) as fp:
-            stuff = ("", "r", _PY_SOURCE)
+        with io.open_code(pathname) as fp:
+            stuff = ("", "rb", _PY_SOURCE)
             self.load_module('__main__', fp, pathname, stuff)
 
     def load_file(self, pathname):
         dir, name = os.path.split(pathname)
         name, ext = os.path.splitext(name)
-        with open(pathname) as fp:
-            stuff = (ext, "r", _PY_SOURCE)
+        with io.open_code(pathname) as fp:
+            stuff = (ext, "rb", _PY_SOURCE)
             self.load_module(name, fp, pathname, stuff)
 
     def import_hook(self, name, caller=None, fromlist=None, level=-1):
@@ -322,6 +320,7 @@
         except ImportError:
             self.msgout(3, "import_module ->", None)
             return None
+
         try:
             m = self.load_module(fqname, fp, pathname, stuff)
         finally:
@@ -340,7 +339,7 @@
             self.msgout(2, "load_module ->", m)
             return m
         if type == _PY_SOURCE:
-            co = compile(fp.read()+'\n', pathname, 'exec')
+            co = compile(fp.read(), pathname, 'exec')
         elif type == _PY_COMPILED:
             try:
                 data = fp.read()
diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
index c9f995e..8e2facf 100644
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -102,7 +102,7 @@
         return 'AF_INET'
     elif type(address) is str and address.startswith('\\\\'):
         return 'AF_PIPE'
-    elif type(address) is str:
+    elif type(address) is str or util.is_abstract_socket_namespace(address):
         return 'AF_UNIX'
     else:
         raise ValueError('address type of %r unrecognized' % address)
@@ -597,7 +597,8 @@
         self._family = family
         self._last_accepted = None
 
-        if family == 'AF_UNIX':
+        if family == 'AF_UNIX' and not util.is_abstract_socket_namespace(address):
+            # Linux abstract socket namespaces do not need to be explicitly unlinked
             self._unlink = util.Finalize(
                 self, os.unlink, args=(address,), exitpriority=0
                 )
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py
index 87ebef6..215ac39 100644
--- a/Lib/multiprocessing/forkserver.py
+++ b/Lib/multiprocessing/forkserver.py
@@ -55,7 +55,8 @@
         os.waitpid(self._forkserver_pid, 0)
         self._forkserver_pid = None
 
-        os.unlink(self._forkserver_address)
+        if not util.is_abstract_socket_namespace(self._forkserver_address):
+            os.unlink(self._forkserver_address)
         self._forkserver_address = None
 
     def set_forkserver_preload(self, modules_names):
@@ -135,7 +136,8 @@
             with socket.socket(socket.AF_UNIX) as listener:
                 address = connection.arbitrary_address('AF_UNIX')
                 listener.bind(address)
-                os.chmod(address, 0o600)
+                if not util.is_abstract_socket_namespace(address):
+                    os.chmod(address, 0o600)
                 listener.listen()
 
                 # all client processes own the write end of the "alive" pipe;
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 7e1818b..85e0d88 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -59,7 +59,7 @@
 
 class Token(object):
     '''
-    Type to uniquely indentify a shared object
+    Type to uniquely identify a shared object
     '''
     __slots__ = ('typeid', 'address', 'id')
 
@@ -821,7 +821,7 @@
 
     def _callmethod(self, methodname, args=(), kwds={}):
         '''
-        Try to call a method of the referrent and return a copy of the result
+        Try to call a method of the referent and return a copy of the result
         '''
         try:
             conn = self._tls.connection
@@ -1289,8 +1289,12 @@
 
         def __init__(self, *args, **kwargs):
             Server.__init__(self, *args, **kwargs)
+            address = self.address
+            # The address of Linux abstract namespaces can be bytes
+            if isinstance(address, bytes):
+                address = os.fsdecode(address)
             self.shared_memory_context = \
-                _SharedMemoryTracker(f"shmm_{self.address}_{getpid()}")
+                _SharedMemoryTracker(f"shm_{address}_{getpid()}")
             util.debug(f"SharedMemoryServer started by pid {getpid()}")
 
         def create(*args, **kwargs):
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index b223d6a..41dd923 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -651,8 +651,6 @@
     def terminate(self):
         util.debug('terminating pool')
         self._state = TERMINATE
-        self._worker_handler._state = TERMINATE
-        self._change_notifier.put(None)
         self._terminate()
 
     def join(self):
@@ -682,7 +680,12 @@
         # this is guaranteed to only be called once
         util.debug('finalizing pool')
 
+        # Notify that the worker_handler state has been changed so the
+        # _handle_workers loop can be unblocked (and exited) in order to
+        # send the finalization sentinel all the workers.
         worker_handler._state = TERMINATE
+        change_notifier.put(None)
+
         task_handler._state = TERMINATE
 
         util.debug('helping task handler/workers to finish')
diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/shared_memory.py
index 184e367..f92eb01 100644
--- a/Lib/multiprocessing/shared_memory.py
+++ b/Lib/multiprocessing/shared_memory.py
@@ -433,9 +433,12 @@
 
         if not isinstance(value, (str, bytes)):
             new_format = self._types_mapping[type(value)]
+            encoded_value = value
         else:
-            if len(value) > self._allocated_bytes[position]:
-                raise ValueError("exceeds available storage for existing str")
+            encoded_value = (value.encode(_encoding)
+                             if isinstance(value, str) else value)
+            if len(encoded_value) > self._allocated_bytes[position]:
+                raise ValueError("bytes/str item exceeds available storage")
             if current_format[-1] == "s":
                 new_format = current_format
             else:
@@ -448,8 +451,7 @@
             new_format,
             value
         )
-        value = value.encode(_encoding) if isinstance(value, str) else value
-        struct.pack_into(new_format, self.shm.buf, offset, value)
+        struct.pack_into(new_format, self.shm.buf, offset, encoded_value)
 
     def __reduce__(self):
         return partial(self.__class__, name=self.shm.name), ()
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index 745f2b2..44abfe5 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -102,6 +102,29 @@
     _log_to_stderr = True
     return _logger
 
+
+# Abstract socket support
+
+def _platform_supports_abstract_sockets():
+    if sys.platform == "linux":
+        return True
+    if hasattr(sys, 'getandroidapilevel'):
+        return True
+    return False
+
+
+def is_abstract_socket_namespace(address):
+    if not address:
+        return False
+    if isinstance(address, bytes):
+        return address[0] == 0
+    elif isinstance(address, str):
+        return address[0] == "\0"
+    raise TypeError('address type of {address!r} unrecognized')
+
+
+abstract_sockets_supported = _platform_supports_abstract_sockets()
+
 #
 # Function returning a temp directory which will be removed on exit
 #
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index 015370a..ff8bac9 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -527,25 +527,29 @@
 
     def _select_from(self, parent_path, is_dir, exists, scandir):
         try:
-            entries = list(scandir(parent_path))
+            with scandir(parent_path) as scandir_it:
+                entries = list(scandir_it)
             for entry in entries:
-                entry_is_dir = False
-                try:
-                    entry_is_dir = entry.is_dir()
-                except OSError as e:
-                    if not _ignore_error(e):
-                        raise
-                if not self.dironly or entry_is_dir:
-                    name = entry.name
-                    if self.match(name):
-                        path = parent_path._make_child_relpath(name)
-                        for p in self.successor._select_from(path, is_dir, exists, scandir):
-                            yield p
+                if self.dironly:
+                    try:
+                        # "entry.is_dir()" can raise PermissionError
+                        # in some cases (see bpo-38894), which is not
+                        # among the errors ignored by _ignore_error()
+                        if not entry.is_dir():
+                            continue
+                    except OSError as e:
+                        if not _ignore_error(e):
+                            raise
+                        continue
+                name = entry.name
+                if self.match(name):
+                    path = parent_path._make_child_relpath(name)
+                    for p in self.successor._select_from(path, is_dir, exists, scandir):
+                        yield p
         except PermissionError:
             return
 
 
-
 class _RecursiveWildcardSelector(_Selector):
 
     def __init__(self, pat, child_parts, flavour):
@@ -554,7 +558,8 @@
     def _iterate_directories(self, parent_path, is_dir, scandir):
         yield parent_path
         try:
-            entries = list(scandir(parent_path))
+            with scandir(parent_path) as scandir_it:
+                entries = list(scandir_it)
             for entry in entries:
                 entry_is_dir = False
                 try:
diff --git a/Lib/platform.py b/Lib/platform.py
index 6fbb7b0..994d892 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -395,9 +395,9 @@
     else:
         try:
             cvkey = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
-            with winreg.OpenKeyEx(HKEY_LOCAL_MACHINE, cvkey) as key:
-                ptype = QueryValueEx(key, 'CurrentType')[0]
-        except:
+            with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, cvkey) as key:
+                ptype = winreg.QueryValueEx(key, 'CurrentType')[0]
+        except OSError:
             pass
 
     return release, version, csd, ptype
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index f1fdb7f..06f0e78 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Feb 24 21:52:17 2020
+# Autogenerated by Sphinx on Wed May 13 19:29:27 2020
 topics = {'assert': 'The "assert" statement\n'
            '**********************\n'
            '\n'
@@ -1475,8 +1475,8 @@
           '                     | starred_and_keywords ["," '
           'keywords_arguments]\n'
           '                     | keywords_arguments\n'
-          '   positional_arguments ::= ["*"] expression ("," ["*"] '
-          'expression)*\n'
+          '   positional_arguments ::= positional_item ("," positional_item)*\n'
+          '   positional_item      ::= assignment_expression | "*" expression\n'
           '   starred_and_keywords ::= ("*" expression | keyword_item)\n'
           '                            ("," "*" expression | "," '
           'keyword_item)*\n'
@@ -1872,9 +1872,9 @@
                 '  value is false. A counter-intuitive implication is that '
                 'not-a-number\n'
                 '  values are not equal to themselves.  For example, if "x =\n'
-                '  float(\'NaN\')", "3 < x", "x < 3", "x == x", "x != x" are '
-                'all false.\n'
-                '  This behavior is compliant with IEEE 754.\n'
+                '  float(\'NaN\')", "3 < x", "x < 3" and "x == x" are all '
+                'false, while "x\n'
+                '  != x" is true.  This behavior is compliant with IEEE 754.\n'
                 '\n'
                 '* "None" and "NotImplemented" are singletons.  **PEP 8** '
                 'advises\n'
@@ -2186,8 +2186,8 @@
              '\n'
              'The "if" statement is used for conditional execution:\n'
              '\n'
-             '   if_stmt ::= "if" expression ":" suite\n'
-             '               ("elif" expression ":" suite)*\n'
+             '   if_stmt ::= "if" assignment_expression ":" suite\n'
+             '               ("elif" assignment_expression ":" suite)*\n'
              '               ["else" ":" suite]\n'
              '\n'
              'It selects exactly one of the suites by evaluating the '
@@ -2210,7 +2210,7 @@
              'an\n'
              'expression is true:\n'
              '\n'
-             '   while_stmt ::= "while" expression ":" suite\n'
+             '   while_stmt ::= "while" assignment_expression ":" suite\n'
              '                  ["else" ":" suite]\n'
              '\n'
              'This repeatedly tests the expression and, if it is true, '
@@ -3136,7 +3136,7 @@
                 '\n'
                 'When a description of an arithmetic operator below uses the '
                 'phrase\n'
-                '“the numeric arguments are converted to a common type,” this '
+                '“the numeric arguments are converted to a common type”, this '
                 'means\n'
                 'that the operator implementation for built-in types works as '
                 'follows:\n'
@@ -4402,8 +4402,8 @@
          '\n'
          'The "if" statement is used for conditional execution:\n'
          '\n'
-         '   if_stmt ::= "if" expression ":" suite\n'
-         '               ("elif" expression ":" suite)*\n'
+         '   if_stmt ::= "if" assignment_expression ":" suite\n'
+         '               ("elif" assignment_expression ":" suite)*\n'
          '               ["else" ":" suite]\n'
          '\n'
          'It selects exactly one of the suites by evaluating the expressions '
@@ -4819,7 +4819,7 @@
               '[","]\n'
               '   starred_expression ::= expression | (starred_item ",")* '
               '[starred_item]\n'
-              '   starred_item       ::= expression | "*" or_expr\n'
+              '   starred_item       ::= assignment_expression | "*" or_expr\n'
               '\n'
               'Except when part of a list or set display, an expression list\n'
               'containing at least one comma yields a tuple.  The length of '
@@ -5129,11 +5129,11 @@
                   'only\n'
                   'supported by the numeric types.\n'
                   '\n'
-                  'A general convention is that an empty format string ("""") '
+                  'A general convention is that an empty format specification '
                   'produces\n'
                   'the same result as if you had called "str()" on the value. '
                   'A non-empty\n'
-                  'format string typically modifies the result.\n'
+                  'format specification typically modifies the result.\n'
                   '\n'
                   'The general form of a *standard format specifier* is:\n'
                   '\n'
@@ -5939,19 +5939,18 @@
                'convention.\n'
                '\n'
                '"__*__"\n'
-               '   System-defined names. These names are defined by the '
-               'interpreter\n'
-               '   and its implementation (including the standard library).  '
-               'Current\n'
-               '   system names are discussed in the Special method names '
-               'section and\n'
-               '   elsewhere.  More will likely be defined in future versions '
-               'of\n'
-               '   Python.  *Any* use of "__*__" names, in any context, that '
-               'does not\n'
-               '   follow explicitly documented use, is subject to breakage '
-               'without\n'
-               '   warning.\n'
+               '   System-defined names, informally known as “dunder” names. '
+               'These\n'
+               '   names are defined by the interpreter and its '
+               'implementation\n'
+               '   (including the standard library). Current system names are\n'
+               '   discussed in the Special method names section and '
+               'elsewhere. More\n'
+               '   will likely be defined in future versions of Python.  *Any* '
+               'use of\n'
+               '   "__*__" names, in any context, that does not follow '
+               'explicitly\n'
+               '   documented use, is subject to breakage without warning.\n'
                '\n'
                '"__*"\n'
                '   Class-private names.  Names in this category, when used '
@@ -6087,19 +6086,19 @@
                 'convention.\n'
                 '\n'
                 '"__*__"\n'
-                '   System-defined names. These names are defined by the '
-                'interpreter\n'
-                '   and its implementation (including the standard library).  '
-                'Current\n'
-                '   system names are discussed in the Special method names '
-                'section and\n'
-                '   elsewhere.  More will likely be defined in future versions '
-                'of\n'
-                '   Python.  *Any* use of "__*__" names, in any context, that '
-                'does not\n'
-                '   follow explicitly documented use, is subject to breakage '
-                'without\n'
-                '   warning.\n'
+                '   System-defined names, informally known as “dunder” names. '
+                'These\n'
+                '   names are defined by the interpreter and its '
+                'implementation\n'
+                '   (including the standard library). Current system names '
+                'are\n'
+                '   discussed in the Special method names section and '
+                'elsewhere. More\n'
+                '   will likely be defined in future versions of Python.  '
+                '*Any* use of\n'
+                '   "__*__" names, in any context, that does not follow '
+                'explicitly\n'
+                '   documented use, is subject to breakage without warning.\n'
                 '\n'
                 '"__*"\n'
                 '   Class-private names.  Names in this category, when used '
@@ -6114,8 +6113,8 @@
        '\n'
        'The "if" statement is used for conditional execution:\n'
        '\n'
-       '   if_stmt ::= "if" expression ":" suite\n'
-       '               ("elif" expression ":" suite)*\n'
+       '   if_stmt ::= "if" assignment_expression ":" suite\n'
+       '               ("elif" assignment_expression ":" suite)*\n'
        '               ["else" ":" suite]\n'
        '\n'
        'It selects exactly one of the suites by evaluating the expressions '
@@ -6984,7 +6983,7 @@
             'program is represented by objects or by relations between '
             'objects. (In\n'
             'a sense, and in conformance to Von Neumann’s model of a “stored\n'
-            'program computer,” code is also represented by objects.)\n'
+            'program computer”, code is also represented by objects.)\n'
             '\n'
             'Every object has an identity, a type and a value.  An object’s\n'
             '*identity* never changes once it has been created; you may think '
@@ -9012,7 +9011,7 @@
                  '\n'
                  'If the metaclass has no "__prepare__" attribute, then the '
                  'class\n'
-                 'namespace is initialised as an empty "dict()".\n'
+                 'namespace is initialised as an empty ordered mapping.\n'
                  '\n'
                  'See also:\n'
                  '\n'
@@ -11432,6 +11431,16 @@
           '      then they can be used interchangeably to index the same\n'
           '      dictionary entry.\n'
           '\n'
+          '      Dictionaries preserve insertion order, meaning that keys will '
+          'be\n'
+          '      produced in the same order they were added sequentially over '
+          'the\n'
+          '      dictionary. Replacing an existing key does not change the '
+          'order,\n'
+          '      however removing a key and re-inserting it will add it to '
+          'the\n'
+          '      end instead of keeping its old place.\n'
+          '\n'
           '      Dictionaries are mutable; they can be created by the "{...}"\n'
           '      notation (see section Dictionary displays).\n'
           '\n'
@@ -11440,6 +11449,13 @@
           '"collections"\n'
           '      module.\n'
           '\n'
+          '      Changed in version 3.7: Dictionaries did not preserve '
+          'insertion\n'
+          '      order in versions of Python before 3.6. In CPython 3.6,\n'
+          '      insertion order was preserved, but it was considered an\n'
+          '      implementation detail at that time rather than a language\n'
+          '      guarantee.\n'
+          '\n'
           'Callable types\n'
           '   These are the types to which the function call operation (see\n'
           '   section Calls) can be applied:\n'
@@ -13589,7 +13605,7 @@
           'The "while" statement is used for repeated execution as long as an\n'
           'expression is true:\n'
           '\n'
-          '   while_stmt ::= "while" expression ":" suite\n'
+          '   while_stmt ::= "while" assignment_expression ":" suite\n'
           '                  ["else" ":" suite]\n'
           '\n'
           'This repeatedly tests the expression and, if it is true, executes '
diff --git a/Lib/re.py b/Lib/re.py
index 8f1d55d..bfb7b1c 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -44,7 +44,7 @@
     "|"      A|B, creates an RE that will match either A or B.
     (...)    Matches the RE inside the parentheses.
              The contents can be retrieved or matched later in the string.
-    (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).
+    (?aiLmsux) The letters set the corresponding flags defined below.
     (?:...)  Non-grouping version of regular parentheses.
     (?P<name>...) The substring matched by the group is accessible by name.
     (?P=name)     Matches the text matched earlier by the group named name.
@@ -97,7 +97,9 @@
     purge     Clear the regular expression cache.
     escape    Backslash all non-alphanumerics in a string.
 
-Some of the functions in this module takes flags as optional parameters:
+Each function other than purge and escape can take an optional 'flags' argument
+consisting of one or more of the following module constants, joined by "|".
+A, L, and U are mutually exclusive.
     A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                    match the corresponding ASCII character categories
                    (rather than the whole Unicode categories, which is the
diff --git a/Lib/runpy.py b/Lib/runpy.py
index 8adc91e..0f54f3e 100644
--- a/Lib/runpy.py
+++ b/Lib/runpy.py
@@ -15,6 +15,7 @@
 import importlib.util
 import io
 import types
+import os
 from pkgutil import read_code, get_importer
 
 __all__ = [
@@ -229,11 +230,12 @@
 
 def _get_code_from_file(run_name, fname):
     # Check for a compiled file first
-    with io.open_code(fname) as f:
+    decoded_path = os.path.abspath(os.fsdecode(fname))
+    with io.open_code(decoded_path) as f:
         code = read_code(f)
     if code is None:
         # That didn't work, so try it as normal source code
-        with io.open_code(fname) as f:
+        with io.open_code(decoded_path) as f:
             code = compile(f.read(), fname, 'exec')
     return code, fname
 
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index dd5aec5..ce97655 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -68,7 +68,7 @@
     def CheckColumnNameWithSpaces(self):
         cur = self.con.cursor()
         cur.execute('select 1 as "foo bar [datetime]"')
-        self.assertEqual(cur.description[0][0], "foo bar")
+        self.assertEqual(cur.description[0][0], "foo bar [datetime]")
 
         cur.execute('select 1 as "foo baz"')
         self.assertEqual(cur.description[0][0], "foo baz")
diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py
index 19ecd07..d26a9cb 100644
--- a/Lib/sqlite3/test/types.py
+++ b/Lib/sqlite3/test/types.py
@@ -275,13 +275,13 @@
 
     def CheckColName(self):
         self.cur.execute("insert into test(x) values (?)", ("xxx",))
-        self.cur.execute('select x as "x [bar]" from test')
+        self.cur.execute('select x as "x y [bar]" from test')
         val = self.cur.fetchone()[0]
         self.assertEqual(val, "<xxx>")
 
         # Check if the stripping of colnames works. Everything after the first
-        # whitespace should be stripped.
-        self.assertEqual(self.cur.description[0][0], "x")
+        # '[' (and the preceeding space) should be stripped.
+        self.assertEqual(self.cur.description[0][0], "x y")
 
     def CheckCaseInConverterName(self):
         self.cur.execute("select 'other' as \"x [b1b1]\"")
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 5bea7cf..ac0a64f 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -197,7 +197,7 @@
         return bool(self.__scope == GLOBAL_EXPLICIT)
 
     def is_local(self):
-        return bool(self.__flags & DEF_BOUND)
+        return bool(self.__scope in (LOCAL, CELL))
 
     def is_annotated(self):
         return bool(self.__flags & DEF_ANNOT)
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 6287554..5b990e0 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -735,7 +735,7 @@
         return self._file.readlines(*args)
 
     def seek(self, *args):
-        self._file.seek(*args)
+        return self._file.seek(*args)
 
     @property
     def softspace(self):
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 983770f..ff58481 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2778,6 +2778,24 @@
         for (j, res) in enumerate(results):
             self.assertEqual(res.get(), sqr(j))
 
+    def test_worker_finalization_via_atexit_handler_of_multiprocessing(self):
+        # tests cases against bpo-38744 and bpo-39360
+        cmd = '''if 1:
+            from multiprocessing import Pool
+            problem = None
+            class A:
+                def __init__(self):
+                    self.pool = Pool(processes=1)
+            def test():
+                global problem
+                problem = A()
+                problem.pool.map(float, tuple(range(10)))
+            if __name__ == "__main__":
+                test()
+        '''
+        rc, out, err = test.support.script_helper.assert_python_ok('-c', cmd)
+        self.assertEqual(rc, 0)
+
 #
 # Test of creating a customized manager class
 #
@@ -3272,6 +3290,19 @@
         if self.TYPE == 'processes':
             self.assertRaises(OSError, l.accept)
 
+    @unittest.skipUnless(util.abstract_sockets_supported,
+                         "test needs abstract socket support")
+    def test_abstract_socket(self):
+        with self.connection.Listener("\0something") as listener:
+            with self.connection.Client(listener.address) as client:
+                with listener.accept() as d:
+                    client.send(1729)
+                    self.assertEqual(d.recv(), 1729)
+
+        if self.TYPE == 'processes':
+            self.assertRaises(OSError, listener.accept)
+
+
 class _TestListenerClient(BaseTestCase):
 
     ALLOWED_TYPES = ('processes', 'threads')
@@ -3797,7 +3828,9 @@
         sms.close()
 
     def test_shared_memory_across_processes(self):
-        sms = shared_memory.SharedMemory('test02_tsmap', True, size=512)
+        # bpo-40135: don't define shared memory block's name in case of
+        # the failure when we run multiprocessing tests in parallel.
+        sms = shared_memory.SharedMemory(create=True, size=512)
         self.addCleanup(sms.unlink)
 
         # Verify remote attachment to existing block by name is working.
@@ -3933,9 +3966,21 @@
         sl[4] = 'some'  # Change type at a given position.
         self.assertEqual(sl[4], 'some')
         self.assertEqual(sl.format, '8s8sdq8sxxxxxxx?q')
-        with self.assertRaises(ValueError):
-            sl[4] = 'far too many'  # Exceeds available storage.
+        with self.assertRaisesRegex(ValueError,
+                                    "exceeds available storage"):
+            sl[4] = 'far too many'
         self.assertEqual(sl[4], 'some')
+        sl[0] = 'encodés'  # Exactly 8 bytes of UTF-8 data
+        self.assertEqual(sl[0], 'encodés')
+        self.assertEqual(sl[1], b'HoWdY')  # no spillage
+        with self.assertRaisesRegex(ValueError,
+                                    "exceeds available storage"):
+            sl[0] = 'encodées'  # Exactly 9 bytes of UTF-8 data
+        self.assertEqual(sl[1], b'HoWdY')
+        with self.assertRaisesRegex(ValueError,
+                                    "exceeds available storage"):
+            sl[1] = b'123456789'
+        self.assertEqual(sl[1], b'HoWdY')
 
         # Exercise count().
         with warnings.catch_warnings():
@@ -5267,10 +5312,9 @@
             dt = time.monotonic() - start_time
             if dt >= 5.0:
                 test.support.environment_altered = True
-                print("Warning -- multiprocessing.Manager still has %s active "
-                      "children after %s seconds"
-                      % (multiprocessing.active_children(), dt),
-                      file=sys.stderr)
+                support.print_warning(f"multiprocessing.Manager still has "
+                                      f"{multiprocessing.active_children()} "
+                                      f"active children after {dt} seconds")
                 break
 
     def run_worker(self, worker, obj):
@@ -5470,15 +5514,13 @@
         processes = set(multiprocessing.process._dangling) - set(cls.dangling[0])
         if processes:
             test.support.environment_altered = True
-            print('Warning -- Dangling processes: %s' % processes,
-                  file=sys.stderr)
+            support.print_warning(f'Dangling processes: {processes}')
         processes = None
 
         threads = set(threading._dangling) - set(cls.dangling[1])
         if threads:
             test.support.environment_altered = True
-            print('Warning -- Dangling threads: %s' % threads,
-                  file=sys.stderr)
+            support.print_warning(f'Dangling threads: {threads}')
         threads = None
 
 
@@ -5546,10 +5588,9 @@
             dt = time.monotonic() - start_time
             if dt >= 5.0:
                 test.support.environment_altered = True
-                print("Warning -- multiprocessing.Manager still has %s active "
-                      "children after %s seconds"
-                      % (multiprocessing.active_children(), dt),
-                      file=sys.stderr)
+                support.print_warning(f"multiprocessing.Manager still has "
+                                      f"{multiprocessing.active_children()} "
+                                      f"active children after {dt} seconds")
                 break
 
         gc.collect()                       # do garbage collection
@@ -5558,9 +5599,9 @@
             # ensure that all processes which hold a reference to a
             # managed object have been joined.
             test.support.environment_altered = True
-            print('Warning -- Shared objects which still exist at manager '
-                  'shutdown:')
-            print(cls.manager._debug_info())
+            support.print_warning('Shared objects which still exist '
+                                  'at manager shutdown:')
+            support.print_warning(cls.manager._debug_info())
         cls.manager.shutdown()
         cls.manager.join()
         cls.manager = None
@@ -5657,16 +5698,14 @@
         if processes:
             need_sleep = True
             test.support.environment_altered = True
-            print('Warning -- Dangling processes: %s' % processes,
-                  file=sys.stderr)
+            support.print_warning(f'Dangling processes: {processes}')
         processes = None
 
         threads = set(threading._dangling) - set(dangling[1])
         if threads:
             need_sleep = True
             test.support.environment_altered = True
-            print('Warning -- Dangling threads: %s' % threads,
-                  file=sys.stderr)
+            support.print_warning(f'Dangling threads: {threads}')
         threads = None
 
         # Sleep 500 ms to give time to child processes to complete.
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py
index 33f3209..b90c4b8 100644
--- a/Lib/test/audit-tests.py
+++ b/Lib/test/audit-tests.py
@@ -327,6 +327,28 @@
     CloseKey(kv)
 
 
+def test_socket():
+    import socket
+
+    def hook(event, args):
+        if event.startswith("socket."):
+            print(event, *args)
+
+    sys.addaudithook(hook)
+
+    socket.gethostname()
+
+    # Don't care if this fails, we just want the audit message
+    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        # Don't care if this fails, we just want the audit message
+        sock.bind(('127.0.0.1', 8080))
+    except Exception:
+        pass
+    finally:
+        sock.close()
+
+
 if __name__ == "__main__":
     from test.libregrtest.setup import suppress_msvcrt_asserts
 
diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test
index 0d84d5e..845b165 100644
--- a/Lib/test/clinic.test
+++ b/Lib/test/clinic.test
@@ -3260,3 +3260,108 @@
 static PyObject *
 test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab)
 /*[clinic end generated code: output=f25914b402039493 input=303df5046c7e37a3]*/
+
+
+/*[clinic input]
+output push
+output preset buffer
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5bff3376ee0df0b5]*/
+
+#ifdef CONDITION_A
+/*[clinic input]
+test_preprocessor_guarded_condition_a
+[clinic start generated code]*/
+
+static PyObject *
+test_preprocessor_guarded_condition_a_impl(PyObject *module)
+/*[clinic end generated code: output=ad012af18085add6 input=8edb8706a98cda7e]*/
+#elif CONDITION_B
+/*[clinic input]
+test_preprocessor_guarded_elif_condition_b
+[clinic start generated code]*/
+
+static PyObject *
+test_preprocessor_guarded_elif_condition_b_impl(PyObject *module)
+/*[clinic end generated code: output=615f2dee82b138d1 input=53777cebbf7fee32]*/
+#else
+/*[clinic input]
+test_preprocessor_guarded_else
+[clinic start generated code]*/
+
+static PyObject *
+test_preprocessor_guarded_else_impl(PyObject *module)
+/*[clinic end generated code: output=13af7670aac51b12 input=6657ab31d74c29fc]*/
+#endif
+
+/*[clinic input]
+dump buffer
+output pop
+[clinic start generated code]*/
+
+#if defined(CONDITION_A)
+
+PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__,
+"test_preprocessor_guarded_condition_a($module, /)\n"
+"--\n"
+"\n");
+
+#define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF    \
+    {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__},
+
+static PyObject *
+test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+    return test_preprocessor_guarded_condition_a_impl(module);
+}
+
+#endif /* defined(CONDITION_A) */
+
+#if !defined(CONDITION_A) && (CONDITION_B)
+
+PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__,
+"test_preprocessor_guarded_elif_condition_b($module, /)\n"
+"--\n"
+"\n");
+
+#define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF    \
+    {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__},
+
+static PyObject *
+test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+    return test_preprocessor_guarded_elif_condition_b_impl(module);
+}
+
+#endif /* !defined(CONDITION_A) && (CONDITION_B) */
+
+#if !defined(CONDITION_A) && !(CONDITION_B)
+
+PyDoc_STRVAR(test_preprocessor_guarded_else__doc__,
+"test_preprocessor_guarded_else($module, /)\n"
+"--\n"
+"\n");
+
+#define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF    \
+    {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__},
+
+static PyObject *
+test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+    return test_preprocessor_guarded_else_impl(module);
+}
+
+#endif /* !defined(CONDITION_A) && !(CONDITION_B) */
+
+#ifndef TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF
+    #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF
+#endif /* !defined(TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF) */
+
+#ifndef TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF
+    #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF
+#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF) */
+
+#ifndef TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF
+    #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF
+#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF) */
+/*[clinic end generated code: output=3804bb18d454038c input=3fc80c9989d2f2e1]*/
diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py
index c8fedc7..c0bb051 100644
--- a/Lib/test/libregrtest/cmdline.py
+++ b/Lib/test/libregrtest/cmdline.py
@@ -207,10 +207,17 @@
     group.add_argument('-m', '--match', metavar='PAT',
                        dest='match_tests', action='append',
                        help='match test cases and methods with glob pattern PAT')
+    group.add_argument('-i', '--ignore', metavar='PAT',
+                       dest='ignore_tests', action='append',
+                       help='ignore test cases and methods with glob pattern PAT')
     group.add_argument('--matchfile', metavar='FILENAME',
                        dest='match_filename',
                        help='similar to --match but get patterns from a '
                             'text file, one pattern per line')
+    group.add_argument('--ignorefile', metavar='FILENAME',
+                       dest='ignore_filename',
+                       help='similar to --matchfile but it receives patterns '
+                            'from text file to ignore')
     group.add_argument('-G', '--failfast', action='store_true',
                        help='fail as soon as a test fails (only with -v or -W)')
     group.add_argument('-u', '--use', metavar='RES1,RES2,...',
@@ -317,7 +324,8 @@
          findleaks=1, use_resources=None, trace=False, coverdir='coverage',
          runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
          random_seed=None, use_mp=None, verbose3=False, forever=False,
-         header=False, failfast=False, match_tests=None, pgo=False)
+         header=False, failfast=False, match_tests=None, ignore_tests=None,
+         pgo=False)
     for k, v in kwargs.items():
         if not hasattr(ns, k):
             raise TypeError('%r is an invalid keyword argument '
@@ -395,6 +403,12 @@
         with open(ns.match_filename) as fp:
             for line in fp:
                 ns.match_tests.append(line.strip())
+    if ns.ignore_filename:
+        if ns.ignore_tests is None:
+            ns.ignore_tests = []
+        with open(ns.ignore_filename) as fp:
+            for line in fp:
+                ns.ignore_tests.append(line.strip())
     if ns.forever:
         # --forever implies --failfast
         ns.failfast = True
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index 76ad335..95b4856 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -287,7 +287,7 @@
 
     def list_cases(self):
         support.verbose = False
-        support.set_match_tests(self.ns.match_tests)
+        support.set_match_tests(self.ns.match_tests, self.ns.ignore_tests)
 
         for test_name in self.selected:
             abstest = get_abs_module(self.ns, test_name)
@@ -394,7 +394,10 @@
 
         save_modules = sys.modules.keys()
 
-        self.log("Run tests sequentially")
+        msg = "Run tests sequentially"
+        if self.ns.timeout:
+            msg += " (timeout: %s)" % format_duration(self.ns.timeout)
+        self.log(msg)
 
         previous_test = None
         for test_index, test_name in enumerate(self.tests, 1):
diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py
index eeb108b..9338b28 100644
--- a/Lib/test/libregrtest/runtest.py
+++ b/Lib/test/libregrtest/runtest.py
@@ -123,7 +123,7 @@
 
     start_time = time.perf_counter()
     try:
-        support.set_match_tests(ns.match_tests)
+        support.set_match_tests(ns.match_tests, ns.ignore_tests)
         support.junit_xml_list = xml_list = [] if ns.xmlpath else None
         if ns.failfast:
             support.failfast = True
@@ -327,7 +327,7 @@
                                f"directory nor file")
 
         if verbose:
-            print_warning("%r left behind %s %r" % (test_name, kind, name))
+            print_warning(f"{test_name} left behind {kind} {name!r}")
             support.environment_altered = True
 
         try:
diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py
index 71db8d6..7a18e45 100644
--- a/Lib/test/libregrtest/runtest_mp.py
+++ b/Lib/test/libregrtest/runtest_mp.py
@@ -3,6 +3,7 @@
 import json
 import os
 import queue
+import signal
 import subprocess
 import sys
 import threading
@@ -31,6 +32,8 @@
 # Time to wait until a worker completes: should be immediate
 JOIN_TIMEOUT = 30.0   # seconds
 
+USE_PROCESS_GROUP = (hasattr(os, "setsid") and hasattr(os, "killpg"))
+
 
 def must_stop(result, ns):
     if result.result == INTERRUPTED:
@@ -59,12 +62,16 @@
     # Running the child from the same working directory as regrtest's original
     # invocation ensures that TEMPDIR for the child is the same when
     # sysconfig.is_python_build() is true. See issue 15300.
+    kw = {}
+    if USE_PROCESS_GROUP:
+        kw['start_new_session'] = True
     return subprocess.Popen(cmd,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE,
                             universal_newlines=True,
                             close_fds=(os.name != 'nt'),
-                            cwd=support.SAVEDCWD)
+                            cwd=support.SAVEDCWD,
+                            **kw)
 
 
 def run_tests_worker(ns, test_name):
@@ -149,11 +156,24 @@
             return
         self._killed = True
 
-        print(f"Kill {self}", file=sys.stderr, flush=True)
+        if USE_PROCESS_GROUP:
+            what = f"{self} process group"
+        else:
+            what = f"{self}"
+
+        print(f"Kill {what}", file=sys.stderr, flush=True)
         try:
-            popen.kill()
+            if USE_PROCESS_GROUP:
+                os.killpg(popen.pid, signal.SIGKILL)
+            else:
+                popen.kill()
+        except ProcessLookupError:
+            # popen.kill(): the process completed, the TestWorkerProcess thread
+            # read its exit status, but Popen.send_signal() read the returncode
+            # just before Popen.wait() set returncode.
+            pass
         except OSError as exc:
-            print_warning(f"Failed to kill {self}: {exc!r}")
+            print_warning(f"Failed to kill {what}: {exc!r}")
 
     def stop(self):
         # Method called from a different thread to stop this thread
@@ -332,7 +352,11 @@
         self.output = queue.Queue()
         self.pending = MultiprocessIterator(self.regrtest.tests)
         if self.ns.timeout is not None:
-            self.worker_timeout = self.ns.timeout * 1.5
+            # Rely on faulthandler to kill a worker process. This timouet is
+            # when faulthandler fails to kill a worker process. Give a maximum
+            # of 5 minutes to faulthandler to kill the worker.
+            self.worker_timeout = min(self.ns.timeout * 1.5,
+                                      self.ns.timeout + 5 * 60)
         else:
             self.worker_timeout = None
         self.workers = None
@@ -340,8 +364,12 @@
     def start_workers(self):
         self.workers = [TestWorkerProcess(index, self)
                         for index in range(1, self.ns.use_mp + 1)]
-        self.log("Run tests in parallel using %s child processes"
-                 % len(self.workers))
+        msg = f"Run tests in parallel using {len(self.workers)} child processes"
+        if self.ns.timeout:
+            msg += (" (timeout: %s, worker timeout: %s)"
+                    % (format_duration(self.ns.timeout),
+                       format_duration(self.worker_timeout)))
+        self.log(msg)
         for worker in self.workers:
             worker.start()
 
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index 98a60f7..0467c8f 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -2,6 +2,7 @@
 import os.path
 import sys
 import textwrap
+from test import support
 
 
 def format_duration(seconds):
@@ -61,4 +62,4 @@
 
 
 def print_warning(msg):
-    print(f"Warning -- {msg}", file=sys.stderr, flush=True)
+    support.print_warning(msg)
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 797b3af..9f3e79f 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -371,6 +371,9 @@
                                 stderr=subprocess.PIPE,
                                 universal_newlines=True)
         version = proc.communicate()[0]
+        if proc.returncode:
+            # ignore gdb failure: test_gdb will log the error
+            return
     except OSError:
         return
 
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index d6a7819..400eebc 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2047,7 +2047,9 @@
 
 # By default, don't filter tests
 _match_test_func = None
-_match_test_patterns = None
+
+_accept_test_patterns = None
+_ignore_test_patterns = None
 
 
 def match_test(test):
@@ -2063,18 +2065,45 @@
     # as a full test identifier.
     # Example: 'test.test_os.FileTests.test_access'.
     #
-    # Reject patterns which contain fnmatch patterns: '*', '?', '[...]'
-    # or '[!...]'. For example, reject 'test_access*'.
+    # ignore patterns which contain fnmatch patterns: '*', '?', '[...]'
+    # or '[!...]'. For example, ignore 'test_access*'.
     return ('.' in pattern) and (not re.search(r'[?*\[\]]', pattern))
 
 
-def set_match_tests(patterns):
-    global _match_test_func, _match_test_patterns
+def set_match_tests(accept_patterns=None, ignore_patterns=None):
+    global _match_test_func, _accept_test_patterns, _ignore_test_patterns
 
-    if patterns == _match_test_patterns:
-        # No change: no need to recompile patterns.
-        return
 
+    if accept_patterns is None:
+        accept_patterns = ()
+    if ignore_patterns is None:
+        ignore_patterns = ()
+
+    accept_func = ignore_func = None
+
+    if accept_patterns != _accept_test_patterns:
+        accept_patterns, accept_func = _compile_match_function(accept_patterns)
+    if ignore_patterns != _ignore_test_patterns:
+        ignore_patterns, ignore_func = _compile_match_function(ignore_patterns)
+
+    # Create a copy since patterns can be mutable and so modified later
+    _accept_test_patterns = tuple(accept_patterns)
+    _ignore_test_patterns = tuple(ignore_patterns)
+
+    if accept_func is not None or ignore_func is not None:
+        def match_function(test_id):
+            accept = True
+            ignore = False
+            if accept_func:
+                accept = accept_func(test_id)
+            if ignore_func:
+                ignore = ignore_func(test_id)
+            return accept and not ignore
+
+        _match_test_func = match_function
+
+
+def _compile_match_function(patterns):
     if not patterns:
         func = None
         # set_match_tests(None) behaves as set_match_tests(())
@@ -2102,10 +2131,7 @@
 
         func = match_test_regex
 
-    # Create a copy since patterns can be mutable and so modified later
-    _match_test_patterns = tuple(patterns)
-    _match_test_func = func
-
+    return patterns, func
 
 
 def run_unittest(*classes):
@@ -2175,6 +2201,12 @@
 #=======================================================================
 # Support for saving and restoring the imported modules.
 
+def print_warning(msg):
+    # bpo-39983: Print into sys.__stderr__ to display the warning even
+    # when sys.stderr is captured temporarily by a test
+    for line in msg.splitlines():
+        print(f"Warning -- {line}", file=sys.__stderr__, flush=True)
+
 def modules_setup():
     return sys.modules.copy(),
 
@@ -2230,14 +2262,12 @@
             # Display a warning at the first iteration
             environment_altered = True
             dangling_threads = values[1]
-            print("Warning -- threading_cleanup() failed to cleanup "
-                  "%s threads (count: %s, dangling: %s)"
-                  % (values[0] - original_values[0],
-                     values[0], len(dangling_threads)),
-                  file=sys.stderr)
+            print_warning(f"threading_cleanup() failed to cleanup "
+                          f"{values[0] - original_values[0]} threads "
+                          f"(count: {values[0]}, "
+                          f"dangling: {len(dangling_threads)})")
             for thread in dangling_threads:
-                print(f"Dangling thread: {thread!r}", file=sys.stderr)
-            sys.stderr.flush()
+                print_warning(f"Dangling thread: {thread!r}")
 
             # Don't hold references to threads
             dangling_threads = None
@@ -2330,8 +2360,7 @@
         if pid == 0:
             break
 
-        print("Warning -- reap_children() reaped child process %s"
-              % pid, file=sys.stderr)
+        print_warning(f"reap_children() reaped child process {pid}")
         environment_altered = True
 
 
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index 388a2b1..1a5d649 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -174,6 +174,29 @@
                             _osx_support._remove_universal_flags(
                                     config_vars))
 
+    def test__remove_universal_flags_alternate(self):
+        # bpo-38360: also test the alternate single-argument form of -isysroot
+        config_vars = {
+        'CFLAGS': '-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  ',
+        'LDFLAGS': '-arch ppc -arch i386   -g',
+        'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk',
+        'BLDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 -g',
+        'LDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 '
+                        '-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g',
+        }
+        expected_vars = {
+        'CFLAGS': '-fno-strict-aliasing  -g -O3    ',
+        'LDFLAGS': '    -g',
+        'CPPFLAGS': '-I.  ',
+        'BLDSHARED': 'gcc-4.0 -bundle    -g',
+        'LDSHARED': 'gcc-4.0 -bundle      -g',
+        }
+        self.add_expected_saved_initial_values(config_vars, expected_vars)
+
+        self.assertEqual(expected_vars,
+                            _osx_support._remove_universal_flags(
+                                    config_vars))
+
     def test__remove_unsupported_archs(self):
         config_vars = {
         'CC': 'clang',
@@ -261,6 +284,34 @@
                             _osx_support._check_for_unavailable_sdk(
                                     config_vars))
 
+    def test__check_for_unavailable_sdk_alternate(self):
+        # bpo-38360: also test the alternate single-argument form of -isysroot
+        config_vars = {
+        'CC': 'clang',
+        'CFLAGS': '-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  '
+                        '-isysroot/Developer/SDKs/MacOSX10.1.sdk',
+        'LDFLAGS': '-arch ppc -arch i386   -g',
+        'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk',
+        'BLDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 -g',
+        'LDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 '
+                        '-isysroot/Developer/SDKs/MacOSX10.1.sdk -g',
+        }
+        expected_vars = {
+        'CC': 'clang',
+        'CFLAGS': '-fno-strict-aliasing  -g -O3 -arch ppc -arch i386  '
+                        ' ',
+        'LDFLAGS': '-arch ppc -arch i386   -g',
+        'CPPFLAGS': '-I.  ',
+        'BLDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 -g',
+        'LDSHARED': 'gcc-4.0 -bundle  -arch ppc -arch i386 '
+                        ' -g',
+        }
+        self.add_expected_saved_initial_values(config_vars, expected_vars)
+
+        self.assertEqual(expected_vars,
+                            _osx_support._check_for_unavailable_sdk(
+                                    config_vars))
+
     def test_get_platform_osx(self):
         # Note, get_platform_osx is currently tested more extensively
         # indirectly by test_sysconfig and test_distutils
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 3e8a39d..8887558 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -869,6 +869,12 @@
         self.assertRaises(ValueError, ast.literal_eval, '3+(0+6j)')
         self.assertRaises(ValueError, ast.literal_eval, '-(3+6j)')
 
+    def test_literal_eval_malformed_dict_nodes(self):
+        malformed = ast.Dict(keys=[ast.Constant(1), ast.Constant(2)], values=[ast.Constant(3)])
+        self.assertRaises(ValueError, ast.literal_eval, malformed)
+        malformed = ast.Dict(keys=[ast.Constant(1)], values=[ast.Constant(2), ast.Constant(3)])
+        self.assertRaises(ValueError, ast.literal_eval, malformed)
+
     def test_bad_integer(self):
         # issue13436: Bad error message with invalid numeric values
         body = [ast.ImportFrom(module='time',
diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py
index fb6321d..62bf877 100644
--- a/Lib/test/test_asyncgen.py
+++ b/Lib/test/test_asyncgen.py
@@ -1191,5 +1191,20 @@
 
         self.loop.run_until_complete(run())
 
+    def test_async_gen_aclose_compatible_with_get_stack(self):
+        async def async_generator():
+            yield object()
+
+        async def run():
+            ag = async_generator()
+            asyncio.create_task(ag.aclose())
+            tasks = asyncio.all_tasks()
+            for task in tasks:
+                # No AttributeError raised
+                task.get_stack()
+
+        self.loop.run_until_complete(run())
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_asyncio/test_context.py b/Lib/test/test_asyncio/test_context.py
index c309faa..63b1eb3 100644
--- a/Lib/test/test_asyncio/test_context.py
+++ b/Lib/test/test_asyncio/test_context.py
@@ -7,6 +7,7 @@
     asyncio.set_event_loop_policy(None)
 
 
+@unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
 class DecimalContextTest(unittest.TestCase):
 
     def test_asyncio_task_decimal_context(self):
diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py
index 73dd5c5..f405c69 100644
--- a/Lib/test/test_audit.py
+++ b/Lib/test/test_audit.py
@@ -118,6 +118,18 @@
         self.assertSequenceEqual(["winreg.EnumKey", " ", f"{expected} 10000"], events[3])
         self.assertSequenceEqual(["winreg.PyHKEY.Detach", " ", expected], events[4])
 
+    def test_socket(self):
+        support.import_module("socket")
+        returncode, events, stderr = self.run_python("test_socket")
+        if returncode:
+            self.fail(stderr)
+
+        if support.verbose:
+            print(*events, sep='\n')
+        self.assertEqual(events[0][0], "socket.gethostname")
+        self.assertEqual(events[1][0], "socket.__new__")
+        self.assertEqual(events[2][0], "socket.bind")
+        self.assertTrue(events[2][2].endswith("('127.0.0.1', 8080)"))
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index dd84faf..dcea206 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -2751,6 +2751,10 @@
         # be 1D, at least one format must be 'c', 'b' or 'B'.
         for _tshape in gencastshapes():
             for char in fmtdict['@']:
+                # Casts to _Bool are undefined if the source contains values
+                # other than 0 or 1.
+                if char == "?":
+                    continue
                 tfmt = ('', '@')[randrange(2)] + char
                 tsize = struct.calcsize(tfmt)
                 n = prod(_tshape) * tsize
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index cc20551..48b0e33 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -390,7 +390,14 @@
             '''async for i in arange(1):
                    a = 1''',
             '''async with asyncio.Lock() as l:
-                   a = 1'''
+                   a = 1''',
+            '''a = [x async for x in arange(2)][1]''',
+            '''a = 1 in {x async for x in arange(2)}''',
+            '''a = {x:1 async for x in arange(1)}[0]''',
+            '''a = [x async for x in arange(2) async for x in arange(2)][1]''',
+            '''a = [x async for x in (x async for x in arange(5))][1]''',
+            '''a, = [1 for x in {x async for x in arange(1)}]''',
+            '''a = [await asyncio.sleep(0, x) async for x in arange(2)][1]'''
         ]
         policy = maybe_get_event_loop_policy()
         try:
@@ -421,6 +428,44 @@
         finally:
             asyncio.set_event_loop_policy(policy)
 
+    def test_compile_top_level_await_invalid_cases(self):
+         # helper function just to check we can run top=level async-for
+        async def arange(n):
+            for i in range(n):
+                yield i
+
+        modes = ('single', 'exec')
+        code_samples = [
+            '''def f():  await arange(10)\n''',
+            '''def f():  [x async for x in arange(10)]\n''',
+            '''def f():  [await x async for x in arange(10)]\n''',
+            '''def f():
+                   async for i in arange(1):
+                       a = 1
+            ''',
+            '''def f():
+                   async with asyncio.Lock() as l:
+                       a = 1
+            '''
+        ]
+        policy = maybe_get_event_loop_policy()
+        try:
+            for mode, code_sample in product(modes, code_samples):
+                source = dedent(code_sample)
+                with self.assertRaises(
+                        SyntaxError, msg=f"source={source} mode={mode}"):
+                    compile(source, '?', mode)
+
+                with self.assertRaises(
+                        SyntaxError, msg=f"source={source} mode={mode}"):
+                    co = compile(source,
+                             '?',
+                             mode,
+                             flags=ast.PyCF_ALLOW_TOP_LEVEL_AWAIT)
+        finally:
+            asyncio.set_event_loop_policy(policy)
+
+
     def test_compile_async_generator(self):
         """
         With the PyCF_ALLOW_TOP_LEVEL_AWAIT flag added in 3.8, we want to
@@ -1745,7 +1790,21 @@
     """Tests that use a pseudo terminal to guarantee stdin and stdout are
     terminals in the test environment"""
 
+    @staticmethod
+    def handle_sighup(signum, frame):
+        # bpo-40140: if the process is the session leader, os.close(fd)
+        # of "pid, fd = pty.fork()" can raise SIGHUP signal:
+        # just ignore the signal.
+        pass
+
     def run_child(self, child, terminal_input):
+        old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup)
+        try:
+            return self._run_child(child, terminal_input)
+        finally:
+            signal.signal(signal.SIGHUP, old_sighup)
+
+    def _run_child(self, child, terminal_input):
         r, w = os.pipe()  # Pipe test results from child back to parent
         try:
             pid, fd = pty.fork()
@@ -1796,6 +1855,9 @@
             child_output = child_output.decode("ascii", "ignore")
             self.fail("got %d lines in pipe but expected 2, child output was:\n%s"
                       % (len(lines), child_output))
+
+        # bpo-40155: Close the PTY before waiting for the child process
+        # completion, otherwise the child process hangs on AIX.
         os.close(fd)
 
         # Wait until the child process completes
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 2761ab3..584c104 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -473,6 +473,20 @@
         # Test that subtype_dealloc decref the newly assigned __class__ only once
         self.assertEqual(new_type_refcnt, sys.getrefcount(_testcapi.HeapCTypeSubclass))
 
+    def test_pynumber_tobase(self):
+        from _testcapi import pynumber_tobase
+        self.assertEqual(pynumber_tobase(123, 2), '0b1111011')
+        self.assertEqual(pynumber_tobase(123, 8), '0o173')
+        self.assertEqual(pynumber_tobase(123, 10), '123')
+        self.assertEqual(pynumber_tobase(123, 16), '0x7b')
+        self.assertEqual(pynumber_tobase(-123, 2), '-0b1111011')
+        self.assertEqual(pynumber_tobase(-123, 8), '-0o173')
+        self.assertEqual(pynumber_tobase(-123, 10), '-123')
+        self.assertEqual(pynumber_tobase(-123, 16), '-0x7b')
+        self.assertRaises(TypeError, pynumber_tobase, 123.0, 10)
+        self.assertRaises(TypeError, pynumber_tobase, '123', 10)
+        self.assertRaises(SystemError, pynumber_tobase, 123, 0)
+
 
 class TestPendingCalls(unittest.TestCase):
 
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 497bfa9..5fc5bff 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -740,6 +740,17 @@
         self.assertEqual(proc.returncode, 0, proc)
         self.assertEqual(proc.stdout.strip(), b'0')
 
+    def test_parsing_error(self):
+        args = [sys.executable, '-I', '--unknown-option']
+        proc = subprocess.run(args,
+                              stdout=subprocess.PIPE,
+                              stderr=subprocess.PIPE,
+                              text=True)
+        err_msg = "unknown option --unknown-option\nusage: "
+        self.assertTrue(proc.stderr.startswith(err_msg), proc.stderr)
+        self.assertNotEqual(proc.returncode, 0)
+
+
 @unittest.skipIf(interpreter_requires_environment(),
                  'Cannot run -I tests when PYTHON env vars are required.')
 class IgnoreEnvironmentTest(unittest.TestCase):
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index b37525b..0fd258c 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -1142,6 +1142,7 @@
             got = ostream.getvalue()
             self.assertEqual(got, unistring)
 
+
 class EscapeDecodeTest(unittest.TestCase):
     def test_empty(self):
         self.assertEqual(codecs.escape_decode(b""), (b"", 0))
@@ -1331,6 +1332,18 @@
             puny = puny.decode("ascii").encode("ascii")
             self.assertEqual(uni, puny.decode("punycode"))
 
+    def test_decode_invalid(self):
+        testcases = [
+            (b"xn--w&", "strict", UnicodeError()),
+            (b"xn--w&", "ignore", "xn-"),
+        ]
+        for puny, errors, expected in testcases:
+            with self.subTest(puny=puny, errors=errors):
+                if isinstance(expected, Exception):
+                    self.assertRaises(UnicodeError, puny.decode, "punycode", errors)
+                else:
+                    self.assertEqual(puny.decode("punycode", errors), expected)
+
 
 # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
 nameprep_tests = [
@@ -1701,6 +1714,14 @@
             self.assertRaises(UnicodeError,
                 codecs.decode, b'abc', 'undefined', errors)
 
+    def test_file_closes_if_lookup_error_raised(self):
+        mock_open = mock.mock_open()
+        with mock.patch('builtins.open', mock_open) as file:
+            with self.assertRaises(LookupError):
+                codecs.open(support.TESTFN, 'wt', 'invalid-encoding')
+
+            file().close.assert_called()
+
 
 class StreamReaderTest(unittest.TestCase):
 
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index 04f6e1e..64f092b 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -577,6 +577,47 @@
             self.assertTrue(compile_dir.called)
             self.assertEqual(compile_dir.call_args[-1]['workers'], 0)
 
+    def _test_ddir_only(self, *, ddir, parallel=True):
+        """Recursive compile_dir ddir must contain package paths; bpo39769."""
+        fullpath = ["test", "foo"]
+        path = self.directory
+        mods = []
+        for subdir in fullpath:
+            path = os.path.join(path, subdir)
+            os.mkdir(path)
+            script_helper.make_script(path, "__init__", "")
+            mods.append(script_helper.make_script(path, "mod",
+                                                  "def fn(): 1/0\nfn()\n"))
+        compileall.compile_dir(
+                self.directory, quiet=True, ddir=ddir,
+                workers=2 if parallel else 1)
+        self.assertTrue(mods)
+        for mod in mods:
+            self.assertTrue(mod.startswith(self.directory), mod)
+            modcode = importlib.util.cache_from_source(mod)
+            modpath = mod[len(self.directory+os.sep):]
+            _, _, err = script_helper.assert_python_failure(modcode)
+            expected_in = os.path.join(ddir, modpath)
+            mod_code_obj = test.test_importlib.util._get_code_from_pyc(modcode)
+            self.assertEqual(mod_code_obj.co_filename, expected_in)
+            self.assertIn(f'"{expected_in}"', os.fsdecode(err))
+
+    def test_ddir_only_one_worker(self):
+        """Recursive compile_dir ddir= contains package paths; bpo39769."""
+        return self._test_ddir_only(ddir="<a prefix>", parallel=False)
+
+    def test_ddir_multiple_workers(self):
+        """Recursive compile_dir ddir= contains package paths; bpo39769."""
+        return self._test_ddir_only(ddir="<a prefix>", parallel=True)
+
+    def test_ddir_empty_only_one_worker(self):
+        """Recursive compile_dir ddir='' contains package paths; bpo39769."""
+        return self._test_ddir_only(ddir="", parallel=False)
+
+    def test_ddir_empty_multiple_workers(self):
+        """Recursive compile_dir ddir='' contains package paths; bpo39769."""
+        return self._test_ddir_only(ddir="", parallel=True)
+
 
 class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase,
                                        unittest.TestCase,
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index e37d842..502b90e 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -8,8 +8,12 @@
 import os
 import sys
 import importlib
+import importlib.abc
+import importlib.util
 import unittest
 import tempfile
+import shutil
+import contextlib
 
 # NOTE: There are some additional tests relating to interaction with
 #       zipimport in the test_zipimport_support test module.
@@ -437,7 +441,7 @@
     >>> tests = finder.find(sample_func)
 
     >>> print(tests)  # doctest: +ELLIPSIS
-    [<DocTest sample_func from ...:21 (1 example)>]
+    [<DocTest sample_func from ...:25 (1 example)>]
 
 The exact name depends on how test_doctest was invoked, so allow for
 leading path components.
@@ -2663,12 +2667,52 @@
     >>> sys.argv = save_argv
 """
 
+class TestImporter(importlib.abc.MetaPathFinder, importlib.abc.ResourceLoader):
+
+    def find_spec(self, fullname, path, target=None):
+        return importlib.util.spec_from_file_location(fullname, path, loader=self)
+
+    def get_data(self, path):
+        with open(path, mode='rb') as f:
+            return f.read()
+
+class TestHook:
+
+    def __init__(self, pathdir):
+        self.sys_path = sys.path[:]
+        self.meta_path = sys.meta_path[:]
+        self.path_hooks = sys.path_hooks[:]
+        sys.path.append(pathdir)
+        sys.path_importer_cache.clear()
+        self.modules_before = sys.modules.copy()
+        self.importer = TestImporter()
+        sys.meta_path.append(self.importer)
+
+    def remove(self):
+        sys.path[:] = self.sys_path
+        sys.meta_path[:] = self.meta_path
+        sys.path_hooks[:] = self.path_hooks
+        sys.path_importer_cache.clear()
+        sys.modules.clear()
+        sys.modules.update(self.modules_before)
+
+
+@contextlib.contextmanager
+def test_hook(pathdir):
+    hook = TestHook(pathdir)
+    try:
+        yield hook
+    finally:
+        hook.remove()
+
+
 def test_lineendings(): r"""
-*nix systems use \n line endings, while Windows systems use \r\n.  Python
+*nix systems use \n line endings, while Windows systems use \r\n, and
+old Mac systems used \r, which Python still recognizes as a line ending.  Python
 handles this using universal newline mode for reading files.  Let's make
 sure doctest does so (issue 8473) by creating temporary test files using each
-of the two line disciplines.  One of the two will be the "wrong" one for the
-platform the test is run on.
+of the three line disciplines.  At least one will not match either the universal
+newline \n or os.linesep for the platform the test is run on.
 
 Windows line endings first:
 
@@ -2691,6 +2735,47 @@
     TestResults(failed=0, attempted=1)
     >>> os.remove(fn)
 
+And finally old Mac line endings:
+
+    >>> fn = tempfile.mktemp()
+    >>> with open(fn, 'wb') as f:
+    ...     f.write(b'Test:\r\r  >>> x = 1 + 1\r\rDone.\r')
+    30
+    >>> doctest.testfile(fn, module_relative=False, verbose=False)
+    TestResults(failed=0, attempted=1)
+    >>> os.remove(fn)
+
+Now we test with a package loader that has a get_data method, since that
+bypasses the standard universal newline handling so doctest has to do the
+newline conversion itself; let's make sure it does so correctly (issue 1812).
+We'll write a file inside the package that has all three kinds of line endings
+in it, and use a package hook to install a custom loader; on any platform,
+at least one of the line endings will raise a ValueError for inconsistent
+whitespace if doctest does not correctly do the newline conversion.
+
+    >>> dn = tempfile.mkdtemp()
+    >>> pkg = os.path.join(dn, "doctest_testpkg")
+    >>> os.mkdir(pkg)
+    >>> support.create_empty_file(os.path.join(pkg, "__init__.py"))
+    >>> fn = os.path.join(pkg, "doctest_testfile.txt")
+    >>> with open(fn, 'wb') as f:
+    ...     f.write(
+    ...         b'Test:\r\n\r\n'
+    ...         b'  >>> x = 1 + 1\r\n\r\n'
+    ...         b'Done.\r\n'
+    ...         b'Test:\n\n'
+    ...         b'  >>> x = 1 + 1\n\n'
+    ...         b'Done.\n'
+    ...         b'Test:\r\r'
+    ...         b'  >>> x = 1 + 1\r\r'
+    ...         b'Done.\r'
+    ...     )
+    95
+    >>> with test_hook(dn):
+    ...     doctest.testfile("doctest_testfile.txt", package="doctest_testpkg", verbose=False)
+    TestResults(failed=0, attempted=3)
+    >>> shutil.rmtree(dn)
+
 """
 
 def test_testmod(): r"""
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index 5414cf0..9e5c6ad 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -11,8 +11,8 @@
 from io import StringIO, BytesIO
 from itertools import chain
 from random import choice
-from socket import getfqdn
 from threading import Thread
+from unittest.mock import patch
 
 import email
 import email.policy
@@ -3342,9 +3342,11 @@
             '.test-idstring@testdomain-string>')
 
     def test_make_msgid_default_domain(self):
-        self.assertTrue(
-            email.utils.make_msgid().endswith(
-                '@' + getfqdn() + '>'))
+        with patch('socket.getfqdn') as mock_getfqdn:
+            mock_getfqdn.return_value = domain = 'pythontest.example.com'
+            self.assertTrue(
+                email.utils.make_msgid().endswith(
+                    '@' + domain + '>'))
 
     def test_Generator_linend(self):
         # Issue 14645.
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index fd468b5..ea13533 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -1,5 +1,7 @@
 # Test various flavors of legal and illegal future statements
 
+import __future__
+import ast
 import unittest
 from test import support
 from textwrap import dedent
@@ -74,6 +76,21 @@
             from test import badsyntax_future10
         self.check_syntax_error(cm.exception, "badsyntax_future10", 3)
 
+    def test_ensure_flags_dont_clash(self):
+        # bpo-39562: test that future flags and compiler flags doesn't clash
+
+        # obtain future flags (CO_FUTURE_***) from the __future__ module
+        flags = {
+            f"CO_FUTURE_{future.upper()}": getattr(__future__, future).compiler_flag
+            for future in __future__.all_feature_names
+        }
+        # obtain some of the exported compiler flags (PyCF_***) from the ast module
+        flags.update({
+            flag: getattr(ast, flag)
+            for flag in dir(ast) if flag.startswith("PyCF_")
+        })
+        self.assertCountEqual(set(flags.values()), flags.values())
+
     def test_parserhack(self):
         # test that the parser.c::future_hack function works as expected
         # Note: although this test must pass, it's not testing the original
@@ -256,6 +273,11 @@
         eq("slice[:-1]")
         eq("slice[1:]")
         eq("slice[::-1]")
+        eq("slice[:,]")
+        eq("slice[1:2,]")
+        eq("slice[1:2:3,]")
+        eq("slice[1:2, 1]")
+        eq("slice[1:2, 2, 3]")
         eq("slice[()]")
         eq("slice[a, b:c, d:e:f]")
         eq("slice[(x for x in a)]")
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index e106033..f043c92 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -17,12 +17,18 @@
 
 def get_gdb_version():
     try:
-        proc = subprocess.Popen(["gdb", "-nx", "--version"],
+        cmd = ["gdb", "-nx", "--version"]
+        proc = subprocess.Popen(cmd,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,
                                 universal_newlines=True)
         with proc:
-            version = proc.communicate()[0]
+            version, stderr = proc.communicate()
+
+        if proc.returncode:
+            raise Exception(f"Command {' '.join(cmd)!r} failed "
+                            f"with exit code {proc.returncode}: "
+                            f"stdout={version!r} stderr={stderr!r}")
     except OSError:
         # This is what "no gdb" looks like.  There may, however, be other
         # errors that manifest this way too.
@@ -230,6 +236,15 @@
                                     " because the Program Counter is"
                                     " not present")
 
+        # bpo-40019: Skip the test if gdb failed to read debug information
+        # because the Python binary is optimized.
+        for pattern in (
+            '(frame information optimized out)',
+            'Unable to read information on python frame',
+        ):
+            if pattern in out:
+                raise unittest.SkipTest(f"{pattern!r} found in gdb output")
+
         return out
 
     def get_gdb_repr(self, source,
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index e1aa414..8f0e27a 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -1155,7 +1155,7 @@
         thread.join()
         self.assertEqual(result, b"proxied data\n")
 
-    def test_putrequest_override_validation(self):
+    def test_putrequest_override_domain_validation(self):
         """
         It should be possible to override the default validation
         behavior in putrequest (bpo-38216).
@@ -1168,6 +1168,17 @@
         conn.sock = FakeSocket('')
         conn.putrequest('GET', '/\x00')
 
+    def test_putrequest_override_host_validation(self):
+        class UnsafeHTTPConnection(client.HTTPConnection):
+            def _validate_host(self, url):
+                pass
+
+        conn = UnsafeHTTPConnection('example.com\r\n')
+        conn.sock = FakeSocket('')
+        # set skip_host so a ValueError is not raised upon adding the
+        # invalid URL as the value of the "Host:" header
+        conn.putrequest('GET', '/', skip_host=1)
+
     def test_putrequest_override_encoding(self):
         """
         It should be possible to override the default encoding
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index e016ea4..e6a1476 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -7,6 +7,7 @@
 from importlib import machinery, util, invalidate_caches
 from importlib.abc import ResourceReader
 import io
+import marshal
 import os
 import os.path
 from pathlib import Path, PurePath
@@ -118,6 +119,16 @@
     return '{}.{}'.format(parent, name), path
 
 
+def _get_code_from_pyc(pyc_path):
+    """Reads a pyc file and returns the unmarshalled code object within.
+
+    No header validation is performed.
+    """
+    with open(pyc_path, 'rb') as pyc_f:
+        pyc_f.seek(16)
+        return marshal.load(pyc_f)
+
+
 @contextlib.contextmanager
 def uncache(*names):
     """Uncache a module from sys.modules.
diff --git a/Lib/test/test_json/test_tool.py b/Lib/test/test_json/test_tool.py
index f362f1b..a62a5d4 100644
--- a/Lib/test/test_json/test_tool.py
+++ b/Lib/test/test_json/test_tool.py
@@ -1,7 +1,9 @@
+import errno
 import os
 import sys
 import textwrap
 import unittest
+
 from subprocess import Popen, PIPE
 from test import support
 from test.support.script_helper import assert_python_ok
@@ -149,3 +151,12 @@
         self.assertEqual(out.splitlines(),
                          self.expect_without_sort_keys.encode().splitlines())
         self.assertEqual(err, b'')
+
+    @unittest.skipIf(sys.platform =="win32", "The test is failed with ValueError on Windows")
+    def test_broken_pipe_error(self):
+        cmd = [sys.executable, '-m', 'json.tool']
+        proc = Popen(cmd, stdout=PIPE, stdin=PIPE)
+        # bpo-39828: Closing before json.tool attempts to write into stdout.
+        proc.stdout.close()
+        proc.communicate(b'"{}"')
+        self.assertEqual(proc.returncode, errno.EPIPE)
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 6abaeea..4a1ba83 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -1878,6 +1878,22 @@
             self.assertIs(type(comb(IntSubclass(5), IntSubclass(k))), int)
             self.assertIs(type(comb(MyIndexable(5), MyIndexable(k))), int)
 
+    def test_issue39871(self):
+        # A SystemError should not be raised if the first arg to atan2(),
+        # copysign(), or remainder() cannot be converted to a float.
+        class F:
+            def __float__(self):
+                self.converted = True
+                1/0
+        for func in math.atan2, math.copysign, math.remainder:
+            y = F()
+            with self.assertRaises(TypeError):
+                func("not a number", y)
+
+            # There should not have been any attempt to convert the second
+            # argument to a float.
+            self.assertFalse(getattr(y, "converted", False))
+
     # Custom assertions.
 
     def assertIsNaN(self, value):
diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py
index ebd96e1..23c7e5f 100644
--- a/Lib/test/test_modulefinder.py
+++ b/Lib/test/test_modulefinder.py
@@ -40,7 +40,8 @@
                                 from c import something
 b/__init__.py
                                 from sys import *
-"""]
+""",
+]
 
 maybe_test_new = [
     "a.module",
@@ -245,6 +246,48 @@
 b/c.py
 """]
 
+coding_default_utf8_test = [
+    "a_utf8",
+    ["a_utf8", "b_utf8"],
+    [], [],
+    """\
+a_utf8.py
+                                # use the default of utf8
+                                print('Unicode test A code point 2090 \u2090 that is not valid in cp1252')
+                                import b_utf8
+b_utf8.py
+                                # use the default of utf8
+                                print('Unicode test B code point 2090 \u2090 that is not valid in cp1252')
+"""]
+
+coding_explicit_utf8_test = [
+    "a_utf8",
+    ["a_utf8", "b_utf8"],
+    [], [],
+    """\
+a_utf8.py
+                                # coding=utf8
+                                print('Unicode test A code point 2090 \u2090 that is not valid in cp1252')
+                                import b_utf8
+b_utf8.py
+                                # use the default of utf8
+                                print('Unicode test B code point 2090 \u2090 that is not valid in cp1252')
+"""]
+
+coding_explicit_cp1252_test = [
+    "a_cp1252",
+    ["a_cp1252", "b_utf8"],
+    [], [],
+    b"""\
+a_cp1252.py
+                                # coding=cp1252
+                                # 0xe2 is not allowed in utf8
+                                print('CP1252 test P\xe2t\xe9')
+                                import b_utf8
+b_utf8.py
+                                # use the default of utf8
+                                print('Unicode test A code point 2090 \u2090 that is not valid in cp1252')
+"""]
 
 def open_file(path):
     dirname = os.path.dirname(path)
@@ -253,30 +296,33 @@
     except OSError as e:
         if e.errno != errno.EEXIST:
             raise
-    return open(path, "w")
+    return open(path, 'wb')
 
 
 def create_package(source):
     ofi = None
     try:
         for line in source.splitlines():
-            if line.startswith(" ") or line.startswith("\t"):
-                ofi.write(line.strip() + "\n")
+            if type(line) != bytes:
+                line = line.encode('utf-8')
+            if line.startswith(b' ') or line.startswith(b'\t'):
+                ofi.write(line.strip() + b'\n')
             else:
                 if ofi:
                     ofi.close()
+                if type(line) == bytes:
+                    line = line.decode('utf-8')
                 ofi = open_file(os.path.join(TEST_DIR, line.strip()))
     finally:
         if ofi:
             ofi.close()
 
-
 class ModuleFinderTest(unittest.TestCase):
-    def _do_test(self, info, report=False, debug=0, replace_paths=[]):
+    def _do_test(self, info, report=False, debug=0, replace_paths=[], modulefinder_class=modulefinder.ModuleFinder):
         import_this, modules, missing, maybe_missing, source = info
         create_package(source)
         try:
-            mf = modulefinder.ModuleFinder(path=TEST_PATH, debug=debug,
+            mf = modulefinder_class(path=TEST_PATH, debug=debug,
                                            replace_paths=replace_paths)
             mf.import_hook(import_this)
             if report:
@@ -337,7 +383,7 @@
         source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0]
         bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0]
         with open_file(source_path) as file:
-            file.write('testing_modulefinder = True\n')
+            file.write('testing_modulefinder = True\n'.encode('utf-8'))
         py_compile.compile(source_path, cfile=bytecode_path)
         os.remove(source_path)
         self._do_test(bytecode_test)
@@ -365,6 +411,26 @@
 """ % list(range(2**16))]  # 2**16 constants
         self._do_test(extended_opargs_test)
 
+    def test_coding_default_utf8(self):
+        self._do_test(coding_default_utf8_test)
+
+    def test_coding_explicit_utf8(self):
+        self._do_test(coding_explicit_utf8_test)
+
+    def test_coding_explicit_cp1252(self):
+        self._do_test(coding_explicit_cp1252_test)
+
+    def test_load_module_api(self):
+        class CheckLoadModuleApi(modulefinder.ModuleFinder):
+            def __init__(self, *args, **kwds):
+                super().__init__(*args, **kwds)
+
+            def load_module(self, fqname, fp, pathname, file_info):
+                # confirm that the fileinfo is a tuple of 3 elements
+                suffix, mode, type = file_info
+                return super().load_module(fqname, fp, pathname, file_info)
+
+        self._do_test(absolute_import_test, modulefinder_class=CheckLoadModuleApi)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py
index 148a9bd..085e5f6 100644
--- a/Lib/test/test_ordered_dict.py
+++ b/Lib/test/test_ordered_dict.py
@@ -753,6 +753,26 @@
                     self.assertEqual(list(unpickled), expected)
                     self.assertEqual(list(it), expected)
 
+    @support.cpython_only
+    def test_weakref_list_is_not_traversed(self):
+        # Check that the weakref list is not traversed when collecting
+        # OrderedDict objects. See bpo-39778 for more information.
+
+        gc.collect()
+
+        x = self.OrderedDict()
+        x.cycle = x
+
+        cycle = []
+        cycle.append(cycle)
+
+        x_ref = weakref.ref(x)
+        cycle.append(x_ref)
+
+        del x, cycle, x_ref
+
+        gc.collect()
+
 
 class PurePythonOrderedDictSubclassTests(PurePythonOrderedDictTests):
 
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 11454b2..2a4ae15 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -2675,12 +2675,37 @@
         # We are the parent of our subprocess
         self.assertEqual(int(stdout), os.getpid())
 
+    def check_waitpid(self, code, exitcode):
+        if sys.platform == 'win32':
+            # On Windows, os.spawnv() simply joins arguments with spaces:
+            # arguments need to be quoted
+            args = [f'"{sys.executable}"', '-c', f'"{code}"']
+        else:
+            args = [sys.executable, '-c', code]
+        pid = os.spawnv(os.P_NOWAIT, sys.executable, args)
+
+        pid2, status = os.waitpid(pid, 0)
+        if sys.platform == 'win32':
+            self.assertEqual(status, exitcode << 8)
+        else:
+            self.assertTrue(os.WIFEXITED(status), status)
+            self.assertEqual(os.WEXITSTATUS(status), exitcode)
+        self.assertEqual(pid2, pid)
+
     def test_waitpid(self):
-        args = [sys.executable, '-c', 'pass']
-        # Add an implicit test for PyUnicode_FSConverter().
-        pid = os.spawnv(os.P_NOWAIT, FakePath(args[0]), args)
-        status = os.waitpid(pid, 0)
-        self.assertEqual(status, (pid, 0))
+        self.check_waitpid(code='pass', exitcode=0)
+
+    def test_waitpid_exitcode(self):
+        exitcode = 23
+        code = f'import sys; sys.exit({exitcode})'
+        self.check_waitpid(code, exitcode=exitcode)
+
+    @unittest.skipUnless(sys.platform == 'win32', 'win32-specific test')
+    def test_waitpid_windows(self):
+        # bpo-40138: test os.waitpid() with exit code larger than INT_MAX.
+        STATUS_CONTROL_C_EXIT = 0xC000013A
+        code = f'import _winapi; _winapi.ExitProcess({STATUS_CONTROL_C_EXIT})'
+        self.check_waitpid(code, exitcode=STATUS_CONTROL_C_EXIT)
 
 
 class SpawnTests(unittest.TestCase):
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 97fc5d8..3622694 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -1508,6 +1508,42 @@
         self.assertEqual(set(p.glob("dirA/../file*")), { P(BASE, "dirA/../fileA") })
         self.assertEqual(set(p.glob("../xyzzy")), set())
 
+    @support.skip_unless_symlink
+    def test_glob_permissions(self):
+        # See bpo-38894
+        P = self.cls
+        base = P(BASE) / 'permissions'
+        base.mkdir()
+
+        file1 = base / "file1"
+        file1.touch()
+        file2 = base / "file2"
+        file2.touch()
+
+        subdir = base / "subdir"
+
+        file3 = base / "file3"
+        file3.symlink_to(subdir / "other")
+
+        # Patching is needed to avoid relying on the filesystem
+        # to return the order of the files as the error will not
+        # happen if the symlink is the last item.
+
+        with mock.patch("os.scandir") as scandir:
+            scandir.return_value = sorted(os.scandir(base))
+            self.assertEqual(len(set(base.glob("*"))), 3)
+
+        subdir.mkdir()
+
+        with mock.patch("os.scandir") as scandir:
+            scandir.return_value = sorted(os.scandir(base))
+            self.assertEqual(len(set(base.glob("*"))), 4)
+
+        subdir.chmod(000)
+
+        with mock.patch("os.scandir") as scandir:
+            scandir.return_value = sorted(os.scandir(base))
+            self.assertEqual(len(set(base.glob("*"))), 4)
 
     def _check_resolve(self, p, expected, strict=True):
         q = p.resolve(strict)
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index ce85f57..dfb3a3f 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -70,7 +70,7 @@
         self.addCleanup(signal.signal, signal.SIGALRM, old_alarm)
 
         old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup)
-        self.addCleanup(signal.signal, signal.SIGHUP, old_alarm)
+        self.addCleanup(signal.signal, signal.SIGHUP, old_sighup)
 
         # isatty() and close() can hang on some platforms. Set an alarm
         # before running the test to make sure we don't hang forever.
@@ -81,8 +81,8 @@
         self.fail("isatty hung")
 
     @staticmethod
-    def handle_sighup(sig, frame):
-        # if the process is the session leader, os.close(master_fd)
+    def handle_sighup(signum, frame):
+        # bpo-38547: if the process is the session leader, os.close(master_fd)
         # of "master_fd, slave_name = pty.master_open()" raises SIGHUP
         # signal: just ignore the signal.
         pass
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index c13a7c9..85740ce 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -21,7 +21,7 @@
             self.assertEqual(e[3], e.pw_gid)
             self.assertIsInstance(e.pw_gid, int)
             self.assertEqual(e[4], e.pw_gecos)
-            self.assertIsInstance(e.pw_gecos, str)
+            self.assertIn(type(e.pw_gecos), (str, type(None)))
             self.assertEqual(e[5], e.pw_dir)
             self.assertIsInstance(e.pw_dir, str)
             self.assertEqual(e[6], e.pw_shell)
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index d2221b3..e2fa197 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -157,6 +157,24 @@
                 self.assertTrue(ns.single)
                 self.checkError([opt, '-f', 'foo'], "don't go together")
 
+    def test_ignore(self):
+        for opt in '-i', '--ignore':
+            with self.subTest(opt=opt):
+                ns = libregrtest._parse_args([opt, 'pattern'])
+                self.assertEqual(ns.ignore_tests, ['pattern'])
+                self.checkError([opt], 'expected one argument')
+
+        self.addCleanup(support.unlink, support.TESTFN)
+        with open(support.TESTFN, "w") as fp:
+            print('matchfile1', file=fp)
+            print('matchfile2', file=fp)
+
+        filename = os.path.abspath(support.TESTFN)
+        ns = libregrtest._parse_args(['-m', 'match',
+                                      '--ignorefile', filename])
+        self.assertEqual(ns.ignore_tests,
+                         ['matchfile1', 'matchfile2'])
+
     def test_match(self):
         for opt in '-m', '--match':
             with self.subTest(opt=opt):
@@ -960,6 +978,42 @@
         regex = re.compile("^(test[^ ]+).*ok$", flags=re.MULTILINE)
         return [match.group(1) for match in regex.finditer(output)]
 
+    def test_ignorefile(self):
+        code = textwrap.dedent("""
+            import unittest
+
+            class Tests(unittest.TestCase):
+                def test_method1(self):
+                    pass
+                def test_method2(self):
+                    pass
+                def test_method3(self):
+                    pass
+                def test_method4(self):
+                    pass
+        """)
+        all_methods = ['test_method1', 'test_method2',
+                       'test_method3', 'test_method4']
+        testname = self.create_test(code=code)
+
+        # only run a subset
+        filename = support.TESTFN
+        self.addCleanup(support.unlink, filename)
+
+        subset = [
+            # only ignore the method name
+            'test_method1',
+            # ignore the full identifier
+            '%s.Tests.test_method3' % testname]
+        with open(filename, "w") as fp:
+            for name in subset:
+                print(name, file=fp)
+
+        output = self.run_tests("-v", "--ignorefile", filename, testname)
+        methods = self.parse_methods(output)
+        subset = ['test_method2', 'test_method4']
+        self.assertEqual(methods, subset)
+
     def test_matchfile(self):
         code = textwrap.dedent("""
             import unittest
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index f003086..84834d3 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -8,6 +8,7 @@
 import importlib, importlib.machinery, importlib.util
 import py_compile
 import warnings
+import pathlib
 from test.support import (
     forget, make_legacy_pyc, unload, verbose, no_tracing,
     create_empty_file, temp_dir)
@@ -652,6 +653,14 @@
             self._check_script(script_name, "<run_path>", script_name,
                                script_name, expect_spec=False)
 
+    def test_basic_script_with_path_object(self):
+        with temp_dir() as script_dir:
+            mod_name = 'script'
+            script_name = pathlib.Path(self._make_test_script(script_dir,
+                                                              mod_name))
+            self._check_script(script_name, "<run_path>", script_name,
+                               script_name, expect_spec=False)
+
     def test_basic_script_no_suffix(self):
         with temp_dir() as script_dir:
             mod_name = 'script'
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 41c4229..1bbc697 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -10,6 +10,7 @@
 from test.support import (captured_stderr, TESTFN, EnvironmentVarGuard,
                           change_cwd)
 import builtins
+import glob
 import os
 import sys
 import re
@@ -512,6 +513,23 @@
 class StartupImportTests(unittest.TestCase):
 
     def test_startup_imports(self):
+        # Get sys.path in isolated mode (python3 -I)
+        popen = subprocess.Popen([sys.executable, '-I', '-c',
+                                  'import sys; print(repr(sys.path))'],
+                                 stdout=subprocess.PIPE,
+                                 encoding='utf-8')
+        stdout = popen.communicate()[0]
+        self.assertEqual(popen.returncode, 0, repr(stdout))
+        isolated_paths = eval(stdout)
+
+        # bpo-27807: Even with -I, the site module executes all .pth files
+        # found in sys.path (see site.addpackage()). Skip the test if at least
+        # one .pth file is found.
+        for path in isolated_paths:
+            pth_files = glob.glob(os.path.join(path, "*.pth"))
+            if pth_files:
+                self.skipTest(f"found {len(pth_files)} .pth files in: {path}")
+
         # This tests checks which modules are loaded by Python when it
         # initially starts upon startup.
         popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
@@ -520,6 +538,7 @@
                                  stderr=subprocess.PIPE,
                                  encoding='utf-8')
         stdout, stderr = popen.communicate()
+        self.assertEqual(popen.returncode, 0, (stdout, stderr))
         modules = eval(stdout)
 
         self.assertIn('site', modules)
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 1bf562a..f9370d8 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -50,6 +50,8 @@
 def get_cid():
     if fcntl is None:
         return None
+    if not hasattr(socket, 'IOCTL_VM_SOCKETS_GET_LOCAL_CID'):
+        return None
     try:
         with open("/dev/vsock", "rb") as f:
             r = fcntl.ioctl(f, socket.IOCTL_VM_SOCKETS_GET_LOCAL_CID, "    ")
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 80acb06..f8fee36 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -682,7 +682,6 @@
             # on adding even when the environment in exec is empty.
             # Gentoo sandboxes also force LD_PRELOAD and SANDBOX_* to exist.
             return ('VERSIONER' in n or '__CF' in n or  # MacOS
-                    '__PYVENV_LAUNCHER__' in n or # MacOS framework build
                     n == 'LD_PRELOAD' or n.startswith('SANDBOX') or # Gentoo
                     n == 'LC_CTYPE') # Locale coercion triggered
 
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 8f0746a..80e652d 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -433,8 +433,12 @@
                 if time.monotonic() > deadline:
                     self.fail("timeout")
 
-                with contextlib.redirect_stderr(stderr):
+                old_stderr = sys.__stderr__
+                try:
+                    sys.__stderr__ = stderr
                     support.reap_children()
+                finally:
+                    sys.__stderr__ = old_stderr
 
                 # Use environment_altered to check if reap_children() found
                 # the child process
@@ -527,6 +531,7 @@
         test_access = Test('test.test_os.FileTests.test_access')
         test_chdir = Test('test.test_os.Win32ErrorTests.test_chdir')
 
+        # Test acceptance
         with support.swap_attr(support, '_match_test_func', None):
             # match all
             support.set_match_tests([])
@@ -534,45 +539,92 @@
             self.assertTrue(support.match_test(test_chdir))
 
             # match all using None
-            support.set_match_tests(None)
+            support.set_match_tests(None, None)
             self.assertTrue(support.match_test(test_access))
             self.assertTrue(support.match_test(test_chdir))
 
             # match the full test identifier
-            support.set_match_tests([test_access.id()])
+            support.set_match_tests([test_access.id()], None)
             self.assertTrue(support.match_test(test_access))
             self.assertFalse(support.match_test(test_chdir))
 
             # match the module name
-            support.set_match_tests(['test_os'])
+            support.set_match_tests(['test_os'], None)
             self.assertTrue(support.match_test(test_access))
             self.assertTrue(support.match_test(test_chdir))
 
             # Test '*' pattern
-            support.set_match_tests(['test_*'])
+            support.set_match_tests(['test_*'], None)
             self.assertTrue(support.match_test(test_access))
             self.assertTrue(support.match_test(test_chdir))
 
             # Test case sensitivity
-            support.set_match_tests(['filetests'])
+            support.set_match_tests(['filetests'], None)
             self.assertFalse(support.match_test(test_access))
-            support.set_match_tests(['FileTests'])
+            support.set_match_tests(['FileTests'], None)
             self.assertTrue(support.match_test(test_access))
 
             # Test pattern containing '.' and a '*' metacharacter
-            support.set_match_tests(['*test_os.*.test_*'])
+            support.set_match_tests(['*test_os.*.test_*'], None)
             self.assertTrue(support.match_test(test_access))
             self.assertTrue(support.match_test(test_chdir))
 
             # Multiple patterns
-            support.set_match_tests([test_access.id(), test_chdir.id()])
+            support.set_match_tests([test_access.id(), test_chdir.id()], None)
             self.assertTrue(support.match_test(test_access))
             self.assertTrue(support.match_test(test_chdir))
 
-            support.set_match_tests(['test_access', 'DONTMATCH'])
+            support.set_match_tests(['test_access', 'DONTMATCH'], None)
             self.assertTrue(support.match_test(test_access))
             self.assertFalse(support.match_test(test_chdir))
 
+        # Test rejection
+        with support.swap_attr(support, '_match_test_func', None):
+            # match all
+            support.set_match_tests(ignore_patterns=[])
+            self.assertTrue(support.match_test(test_access))
+            self.assertTrue(support.match_test(test_chdir))
+
+            # match all using None
+            support.set_match_tests(None, None)
+            self.assertTrue(support.match_test(test_access))
+            self.assertTrue(support.match_test(test_chdir))
+
+            # match the full test identifier
+            support.set_match_tests(None, [test_access.id()])
+            self.assertFalse(support.match_test(test_access))
+            self.assertTrue(support.match_test(test_chdir))
+
+            # match the module name
+            support.set_match_tests(None, ['test_os'])
+            self.assertFalse(support.match_test(test_access))
+            self.assertFalse(support.match_test(test_chdir))
+
+            # Test '*' pattern
+            support.set_match_tests(None, ['test_*'])
+            self.assertFalse(support.match_test(test_access))
+            self.assertFalse(support.match_test(test_chdir))
+
+            # Test case sensitivity
+            support.set_match_tests(None, ['filetests'])
+            self.assertTrue(support.match_test(test_access))
+            support.set_match_tests(None, ['FileTests'])
+            self.assertFalse(support.match_test(test_access))
+
+            # Test pattern containing '.' and a '*' metacharacter
+            support.set_match_tests(None, ['*test_os.*.test_*'])
+            self.assertFalse(support.match_test(test_access))
+            self.assertFalse(support.match_test(test_chdir))
+
+            # Multiple patterns
+            support.set_match_tests(None, [test_access.id(), test_chdir.id()])
+            self.assertFalse(support.match_test(test_access))
+            self.assertFalse(support.match_test(test_chdir))
+
+            support.set_match_tests(None, ['test_access', 'DONTMATCH'])
+            self.assertFalse(support.match_test(test_access))
+            self.assertTrue(support.match_test(test_chdir))
+
     def test_fd_count(self):
         # We cannot test the absolute value of fd_count(): on old Linux
         # kernel or glibc versions, os.urandom() keeps a FD open on
@@ -585,6 +637,24 @@
             os.close(fd)
         self.assertEqual(more - start, 1)
 
+    def check_print_warning(self, msg, expected):
+        stderr = io.StringIO()
+
+        old_stderr = sys.__stderr__
+        try:
+            sys.__stderr__ = stderr
+            support.print_warning(msg)
+        finally:
+            sys.__stderr__ = old_stderr
+
+        self.assertEqual(stderr.getvalue(), expected)
+
+    def test_print_warning(self):
+        self.check_print_warning("msg",
+                                 "Warning -- msg\n")
+        self.check_print_warning("a\nb",
+                                 'Warning -- a\nWarning -- b\n')
+
     # XXX -follows a list of untested API
     # make_legacy_pyc
     # is_resource_enabled
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index bea2ce1..98d718c 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -99,6 +99,7 @@
         self.assertTrue(self.spam.lookup("bar").is_declared_global())
         self.assertFalse(self.internal.lookup("x").is_global())
         self.assertFalse(self.Mine.lookup("instance_var").is_global())
+        self.assertTrue(self.spam.lookup("bar").is_global())
 
     def test_nonlocal(self):
         self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
@@ -108,7 +109,10 @@
 
     def test_local(self):
         self.assertTrue(self.spam.lookup("x").is_local())
-        self.assertFalse(self.internal.lookup("x").is_local())
+        self.assertFalse(self.spam.lookup("bar").is_local())
+
+    def test_free(self):
+        self.assertTrue(self.internal.lookup("x").is_free())
 
     def test_referenced(self):
         self.assertTrue(self.internal.lookup("x").is_referenced())
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 232c5da..f129454 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -1025,7 +1025,8 @@
         # Verify writelines with a SpooledTemporaryFile
         f = self.do_create()
         f.writelines((b'x', b'y', b'z'))
-        f.seek(0)
+        pos = f.seek(0)
+        self.assertEqual(pos, 0)
         buf = f.read()
         self.assertEqual(buf, b'xyz')
 
@@ -1043,7 +1044,8 @@
         # when that occurs
         f = self.do_create(max_size=30)
         self.assertFalse(f._rolled)
-        f.seek(100, 0)
+        pos = f.seek(100, 0)
+        self.assertEqual(pos, 100)
         self.assertFalse(f._rolled)
         f.write(b'x')
         self.assertTrue(f._rolled)
diff --git a/Lib/test/test_tools/test_unparse.py b/Lib/test/test_tools/test_unparse.py
index a958ebb..d89cb09 100644
--- a/Lib/test/test_tools/test_unparse.py
+++ b/Lib/test/test_tools/test_unparse.py
@@ -265,6 +265,20 @@
         self.check_roundtrip(r"""{**{'y': 2}, 'x': 1}""")
         self.check_roundtrip(r"""{**{'y': 2}, **{'x': 1}}""")
 
+    def test_subscript(self):
+        self.check_roundtrip("a[i]")
+        self.check_roundtrip("a[i,]")
+        self.check_roundtrip("a[i, j]")
+        self.check_roundtrip("a[()]")
+        self.check_roundtrip("a[i:j]")
+        self.check_roundtrip("a[:j]")
+        self.check_roundtrip("a[i:]")
+        self.check_roundtrip("a[i:j:k]")
+        self.check_roundtrip("a[:j:k]")
+        self.check_roundtrip("a[i::k]")
+        self.check_roundtrip("a[i:j,]")
+        self.check_roundtrip("a[i:j, k]")
+
 
 class DirectoryTestCase(ASTTestCase):
     """Test roundtrip behaviour on all files in Lib and Lib/test."""
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index ded5a8b..83bfef1 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -220,6 +220,13 @@
         with self.assertRaises(TypeError):
             TypeVar('X', str, float, bound=Employee)
 
+    def test_missing__name__(self):
+        # See bpo-39942
+        code = ("import typing\n"
+                "T = typing.TypeVar('T')\n"
+                )
+        exec(code, {})
+
     def test_no_bivariant(self):
         with self.assertRaises(ValueError):
             TypeVar('T', covariant=True, contravariant=True)
@@ -2906,6 +2913,9 @@
         self.assertIs(get_origin(Generic), Generic)
         self.assertIs(get_origin(Generic[T]), Generic)
         self.assertIs(get_origin(List[Tuple[T, T]][int]), list)
+        self.assertIs(get_origin(List), list)
+        self.assertIs(get_origin(Tuple), tuple)
+        self.assertIs(get_origin(Callable), collections.abc.Callable)
 
     def test_get_args(self):
         T = TypeVar('T')
@@ -2921,11 +2931,15 @@
                          (int, Tuple[str, int]))
         self.assertEqual(get_args(typing.Dict[int, Tuple[T, T]][Optional[int]]),
                          (int, Tuple[Optional[int], Optional[int]]))
-        self.assertEqual(get_args(Callable[[], T][int]), ([], int,))
+        self.assertEqual(get_args(Callable[[], T][int]), ([], int))
+        self.assertEqual(get_args(Callable[..., int]), (..., int))
         self.assertEqual(get_args(Union[int, Callable[[Tuple[T, ...]], str]]),
                          (int, Callable[[Tuple[T, ...]], str]))
         self.assertEqual(get_args(Tuple[int, ...]), (int, ...))
         self.assertEqual(get_args(Tuple[()]), ((),))
+        self.assertEqual(get_args(List), ())
+        self.assertEqual(get_args(Tuple), ())
+        self.assertEqual(get_args(Callable), ())
 
 
 class CollectionsAbcTests(BaseTestCase):
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index e9c656c..1c247c5 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -361,7 +361,7 @@
             self.unfakehttp()
 
     @unittest.skipUnless(ssl, "ssl module required")
-    def test_url_with_control_char_rejected(self):
+    def test_url_path_with_control_char_rejected(self):
         for char_no in list(range(0, 0x21)) + [0x7f]:
             char = chr(char_no)
             schemeless_url = f"//localhost:7777/test{char}/"
@@ -388,7 +388,7 @@
                 self.unfakehttp()
 
     @unittest.skipUnless(ssl, "ssl module required")
-    def test_url_with_newline_header_injection_rejected(self):
+    def test_url_path_with_newline_header_injection_rejected(self):
         self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
         host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
         schemeless_url = "//" + host + ":8080/test/?test=a"
@@ -413,6 +413,38 @@
         finally:
             self.unfakehttp()
 
+    @unittest.skipUnless(ssl, "ssl module required")
+    def test_url_host_with_control_char_rejected(self):
+        for char_no in list(range(0, 0x21)) + [0x7f]:
+            char = chr(char_no)
+            schemeless_url = f"//localhost{char}/test/"
+            self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
+            try:
+                escaped_char_repr = repr(char).replace('\\', r'\\')
+                InvalidURL = http.client.InvalidURL
+                with self.assertRaisesRegex(
+                    InvalidURL, f"contain control.*{escaped_char_repr}"):
+                    urlopen(f"http:{schemeless_url}")
+                with self.assertRaisesRegex(InvalidURL, f"contain control.*{escaped_char_repr}"):
+                    urlopen(f"https:{schemeless_url}")
+            finally:
+                self.unfakehttp()
+
+    @unittest.skipUnless(ssl, "ssl module required")
+    def test_url_host_with_newline_header_injection_rejected(self):
+        self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
+        host = "localhost\r\nX-injected: header\r\n"
+        schemeless_url = "//" + host + ":8080/test/?test=a"
+        try:
+            InvalidURL = http.client.InvalidURL
+            with self.assertRaisesRegex(
+                InvalidURL, r"contain control.*\\r"):
+                urlopen(f"http:{schemeless_url}")
+            with self.assertRaisesRegex(InvalidURL, r"contain control.*\\n"):
+                urlopen(f"https:{schemeless_url}")
+        finally:
+            self.unfakehttp()
+
     def test_read_0_9(self):
         # "0.9" response accepted (but not "simple responses" without
         # a status line)
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 61e3ecc..091b397 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -1444,40 +1444,64 @@
         bypass = {'exclude_simple': True, 'exceptions': []}
         self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass))
 
-    def test_basic_auth(self, quote_char='"'):
-        opener = OpenerDirector()
-        password_manager = MockPasswordManager()
-        auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
-        realm = "ACME Widget Store"
-        http_handler = MockHTTPHandler(
-            401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' %
-            (quote_char, realm, quote_char))
-        opener.add_handler(auth_handler)
-        opener.add_handler(http_handler)
-        self._test_basic_auth(opener, auth_handler, "Authorization",
-                              realm, http_handler, password_manager,
-                              "http://acme.example.com/protected",
-                              "http://acme.example.com/protected",
-                              )
-
-    def test_basic_auth_with_single_quoted_realm(self):
-        self.test_basic_auth(quote_char="'")
-
-    def test_basic_auth_with_unquoted_realm(self):
-        opener = OpenerDirector()
-        password_manager = MockPasswordManager()
-        auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
-        realm = "ACME Widget Store"
-        http_handler = MockHTTPHandler(
-            401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm)
-        opener.add_handler(auth_handler)
-        opener.add_handler(http_handler)
-        with self.assertWarns(UserWarning):
+    def check_basic_auth(self, headers, realm):
+        with self.subTest(realm=realm, headers=headers):
+            opener = OpenerDirector()
+            password_manager = MockPasswordManager()
+            auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
+            body = '\r\n'.join(headers) + '\r\n\r\n'
+            http_handler = MockHTTPHandler(401, body)
+            opener.add_handler(auth_handler)
+            opener.add_handler(http_handler)
             self._test_basic_auth(opener, auth_handler, "Authorization",
-                                realm, http_handler, password_manager,
-                                "http://acme.example.com/protected",
-                                "http://acme.example.com/protected",
-                                )
+                                  realm, http_handler, password_manager,
+                                  "http://acme.example.com/protected",
+                                  "http://acme.example.com/protected")
+
+    def test_basic_auth(self):
+        realm = "realm2@example.com"
+        realm2 = "realm2@example.com"
+        basic = f'Basic realm="{realm}"'
+        basic2 = f'Basic realm="{realm2}"'
+        other_no_realm = 'Otherscheme xxx'
+        digest = (f'Digest realm="{realm2}", '
+                  f'qop="auth, auth-int", '
+                  f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", '
+                  f'opaque="5ccc069c403ebaf9f0171e9517f40e41"')
+        for realm_str in (
+            # test "quote" and 'quote'
+            f'Basic realm="{realm}"',
+            f"Basic realm='{realm}'",
+
+            # charset is ignored
+            f'Basic realm="{realm}", charset="UTF-8"',
+
+            # Multiple challenges per header
+            f'{basic}, {basic2}',
+            f'{basic}, {other_no_realm}',
+            f'{other_no_realm}, {basic}',
+            f'{basic}, {digest}',
+            f'{digest}, {basic}',
+        ):
+            headers = [f'WWW-Authenticate: {realm_str}']
+            self.check_basic_auth(headers, realm)
+
+        # no quote: expect a warning
+        with support.check_warnings(("Basic Auth Realm was unquoted",
+                                     UserWarning)):
+            headers = [f'WWW-Authenticate: Basic realm={realm}']
+            self.check_basic_auth(headers, realm)
+
+        # Multiple headers: one challenge per header.
+        # Use the first Basic realm.
+        for challenges in (
+            [basic,  basic2],
+            [basic,  digest],
+            [digest, basic],
+        ):
+            headers = [f'WWW-Authenticate: {challenge}'
+                       for challenge in challenges]
+            self.check_basic_auth(headers, realm)
 
     def test_proxy_basic_auth(self):
         opener = OpenerDirector()
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index ede6593..bc4e95f 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -358,6 +358,18 @@
         self.assertEqual(err, "".encode())
 
 
+    @unittest.skipUnless(sys.platform == 'darwin', 'only relevant on macOS')
+    def test_macos_env(self):
+        rmtree(self.env_dir)
+        builder = venv.EnvBuilder()
+        builder.create(self.env_dir)
+
+        envpy = os.path.join(os.path.realpath(self.env_dir),
+                             self.bindir, self.exe)
+        out, err = check_output([envpy, '-c',
+            'import os; print("__PYVENV_LAUNCHER__" in os.environ)'])
+        self.assertEqual(out.strip(), 'False'.encode())
+
 @requireVenvCreate
 class EnsurePipTest(BaseTest):
     """Test venv module installation of pip."""
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py
index 2144d20..e26e171 100644
--- a/Lib/test/test_xml_etree_c.py
+++ b/Lib/test/test_xml_etree_c.py
@@ -118,6 +118,21 @@
         elem.tail = X()
         elem.__setstate__({'tag': 42})  # shouldn't cause an assertion failure
 
+    @support.cpython_only
+    def test_uninitialized_parser(self):
+        # The interpreter shouldn't crash in case of calling methods or
+        # accessing attributes of uninitialized XMLParser objects.
+        parser = cET.XMLParser.__new__(cET.XMLParser)
+        self.assertRaises(ValueError, parser.close)
+        self.assertRaises(ValueError, parser.feed, 'foo')
+        class MockFile:
+            def read(*args):
+                return ''
+        self.assertRaises(ValueError, parser._parse_whole, MockFile())
+        self.assertRaises(ValueError, parser._setevents, None)
+        self.assertIsNone(parser.entity)
+        self.assertIsNone(parser.target)
+
     def test_setstate_leaks(self):
         # Test reference leaks
         elem = cET.Element.__new__(cET.Element)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 61bca86..28e62dc 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -5,6 +5,7 @@
 import os
 import pathlib
 import posixpath
+import string
 import struct
 import subprocess
 import sys
@@ -2933,6 +2934,11 @@
         # Check the file iterated all items
         assert entries.count == self.HUGE_ZIPFILE_NUM_ENTRIES
 
+    # @func_timeout.func_set_timeout(3)
+    def test_implied_dirs_performance(self):
+        data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)]
+        zipfile.CompleteDirs._implied_dirs(data)
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/threading.py b/Lib/threading.py
index 2f6ac70..813dae2 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1421,7 +1421,15 @@
 
     # fork() only copied the current thread; clear references to others.
     new_active = {}
-    current = current_thread()
+
+    try:
+        current = _active[get_ident()]
+    except KeyError:
+        # fork() was called in a thread which was not spawned
+        # by threading.Thread. For example, a thread spawned
+        # by thread.start_new_thread().
+        current = _MainThread()
+
     _main_thread = current
 
     # reset _shutdown() locks: threads re-register their _tstate_lock below
diff --git a/Lib/timeit.py b/Lib/timeit.py
index c0362bc..6c3ec01 100755
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -29,7 +29,8 @@
 treated similarly.
 
 If -n is not given, a suitable number of loops is calculated by trying
-successive powers of 10 until the total time is at least 0.2 seconds.
+increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
+total time is at least 0.2 seconds.
 
 Note: there is a certain baseline overhead associated with executing a
 pass statement.  It differs between versions.  The code here doesn't try
diff --git a/Lib/traceback.py b/Lib/traceback.py
index ab35da9..5ef3be7 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -549,7 +549,7 @@
         The return value is a generator of strings, each ending in a newline.
 
         Normally, the generator emits a single string; however, for
-        SyntaxError exceptions, it emites several lines that (when
+        SyntaxError exceptions, it emits several lines that (when
         printed) display detailed information about where the syntax
         error occurred.
 
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py
index 17fe9a7..12be509 100644
--- a/Lib/turtledemo/__main__.py
+++ b/Lib/turtledemo/__main__.py
@@ -272,7 +272,7 @@
         self.stop_btn.config(state=stop,
                              bg="#d00" if stop == NORMAL else "#fca")
         self.clear_btn.config(state=clear,
-                              bg="#d00" if clear == NORMAL else"#fca")
+                              bg="#d00" if clear == NORMAL else "#fca")
         self.output_lbl.config(text=txt, fg=color)
 
     def makeLoadDemoMenu(self, master):
diff --git a/Lib/typing.py b/Lib/typing.py
index 7aab8db..589eea9 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -600,7 +600,10 @@
             self.__bound__ = _type_check(bound, "Bound must be a type.")
         else:
             self.__bound__ = None
-        def_mod = sys._getframe(1).f_globals['__name__']  # for pickling
+        try:
+            def_mod = sys._getframe(1).f_globals.get('__name__', '__main__')  # for pickling
+        except (AttributeError, ValueError):
+            def_mod = None
         if def_mod != 'typing':
             self.__module__ = def_mod
 
@@ -1297,7 +1300,7 @@
         get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
         get_args(Callable[[], T][int]) == ([], int)
     """
-    if isinstance(tp, _GenericAlias):
+    if isinstance(tp, _GenericAlias) and not tp._special:
         res = tp.__args__
         if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
             res = (list(res[:-1]), res[-1])
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 204b3e7..3629cf6 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -1229,11 +1229,6 @@
     return thing
 
 
-def _is_started(patcher):
-    # XXXX horrible
-    return hasattr(patcher, 'is_local')
-
-
 class _patch(object):
 
     attribute_name = None
@@ -1304,14 +1299,9 @@
     @contextlib.contextmanager
     def decoration_helper(self, patched, args, keywargs):
         extra_args = []
-        entered_patchers = []
-        patching = None
-
-        exc_info = tuple()
-        try:
+        with contextlib.ExitStack() as exit_stack:
             for patching in patched.patchings:
-                arg = patching.__enter__()
-                entered_patchers.append(patching)
+                arg = exit_stack.enter_context(patching)
                 if patching.attribute_name is not None:
                     keywargs.update(arg)
                 elif patching.new is DEFAULT:
@@ -1319,19 +1309,6 @@
 
             args += tuple(extra_args)
             yield (args, keywargs)
-        except:
-            if (patching not in entered_patchers and
-                _is_started(patching)):
-                # the patcher may have been started, but an exception
-                # raised whilst entering one of its additional_patchers
-                entered_patchers.append(patching)
-            # Pass the exception to __exit__
-            exc_info = sys.exc_info()
-            # re-raise the exception
-            raise
-        finally:
-            for patching in reversed(entered_patchers):
-                patching.__exit__(*exc_info)
 
 
     def decorate_callable(self, func):
@@ -1508,25 +1485,26 @@
 
         self.temp_original = original
         self.is_local = local
-        setattr(self.target, self.attribute, new_attr)
-        if self.attribute_name is not None:
-            extra_args = {}
-            if self.new is DEFAULT:
-                extra_args[self.attribute_name] =  new
-            for patching in self.additional_patchers:
-                arg = patching.__enter__()
-                if patching.new is DEFAULT:
-                    extra_args.update(arg)
-            return extra_args
+        self._exit_stack = contextlib.ExitStack()
+        try:
+            setattr(self.target, self.attribute, new_attr)
+            if self.attribute_name is not None:
+                extra_args = {}
+                if self.new is DEFAULT:
+                    extra_args[self.attribute_name] =  new
+                for patching in self.additional_patchers:
+                    arg = self._exit_stack.enter_context(patching)
+                    if patching.new is DEFAULT:
+                        extra_args.update(arg)
+                return extra_args
 
-        return new
-
+            return new
+        except:
+            if not self.__exit__(*sys.exc_info()):
+                raise
 
     def __exit__(self, *exc_info):
         """Undo the patch."""
-        if not _is_started(self):
-            return
-
         if self.is_local and self.temp_original is not DEFAULT:
             setattr(self.target, self.attribute, self.temp_original)
         else:
@@ -1541,9 +1519,9 @@
         del self.temp_original
         del self.is_local
         del self.target
-        for patcher in reversed(self.additional_patchers):
-            if _is_started(patcher):
-                patcher.__exit__(*exc_info)
+        exit_stack = self._exit_stack
+        del self._exit_stack
+        return exit_stack.__exit__(*exc_info)
 
 
     def start(self):
@@ -1559,9 +1537,9 @@
             self._active_patches.remove(self)
         except ValueError:
             # If the patch hasn't been started this will fail
-            pass
+            return None
 
-        return self.__exit__()
+        return self.__exit__(None, None, None)
 
 
 
@@ -2136,7 +2114,7 @@
         # This is nearly just like super(), except for sepcial handling
         # of coroutines
 
-        _call = self.call_args
+        _call = _Call((args, kwargs), two=True)
         self.await_count += 1
         self.await_args = _call
         self.await_args_list.append(_call)
diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/unittest/test/testmock/testasync.py
index e68022a..e84c66c 100644
--- a/Lib/unittest/test/testmock/testasync.py
+++ b/Lib/unittest/test/testmock/testasync.py
@@ -496,6 +496,17 @@
         mock.assert_awaited()
         self.assertTrue(ran)
 
+    async def test_await_args_list_order(self):
+        async_mock = AsyncMock()
+        mock2 = async_mock(2)
+        mock1 = async_mock(1)
+        await mock1
+        await mock2
+        async_mock.assert_has_awaits([call(1), call(2)])
+        self.assertEqual(async_mock.await_args_list, [call(1), call(2)])
+        self.assertEqual(async_mock.call_args_list, [call(2), call(1)])
+
+
 class AsyncMagicMethods(unittest.TestCase):
     def test_async_magic_methods_return_async_mocks(self):
         m_mock = MagicMock()
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 6f6577b..e440738 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -945,8 +945,15 @@
 
     # allow for double- and single-quoted realm values
     # (single quotes are a violation of the RFC, but appear in the wild)
-    rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+'
-                    'realm=(["\']?)([^"\']*)\\2', re.I)
+    rx = re.compile('(?:^|,)'   # start of the string or ','
+                    '[ \t]*'    # optional whitespaces
+                    '([^ \t]+)' # scheme like "Basic"
+                    '[ \t]+'    # mandatory whitespaces
+                    # realm=xxx
+                    # realm='xxx'
+                    # realm="xxx"
+                    'realm=(["\']?)([^"\']*)\\2',
+                    re.I)
 
     # XXX could pre-emptively send auth info already accepted (RFC 2617,
     # end of section 2, and section 1.2 immediately after "credentials"
@@ -958,27 +965,51 @@
         self.passwd = password_mgr
         self.add_password = self.passwd.add_password
 
+    def _parse_realm(self, header):
+        # parse WWW-Authenticate header: accept multiple challenges per header
+        found_challenge = False
+        for mo in AbstractBasicAuthHandler.rx.finditer(header):
+            scheme, quote, realm = mo.groups()
+            if quote not in ['"', "'"]:
+                warnings.warn("Basic Auth Realm was unquoted",
+                              UserWarning, 3)
+
+            yield (scheme, realm)
+
+            found_challenge = True
+
+        if not found_challenge:
+            if header:
+                scheme = header.split()[0]
+            else:
+                scheme = ''
+            yield (scheme, None)
+
     def http_error_auth_reqed(self, authreq, host, req, headers):
         # host may be an authority (without userinfo) or a URL with an
         # authority
-        # XXX could be multiple headers
-        authreq = headers.get(authreq, None)
+        headers = headers.get_all(authreq)
+        if not headers:
+            # no header found
+            return
 
-        if authreq:
-            scheme = authreq.split()[0]
-            if scheme.lower() != 'basic':
-                raise ValueError("AbstractBasicAuthHandler does not"
-                                 " support the following scheme: '%s'" %
-                                 scheme)
-            else:
-                mo = AbstractBasicAuthHandler.rx.search(authreq)
-                if mo:
-                    scheme, quote, realm = mo.groups()
-                    if quote not in ['"',"'"]:
-                        warnings.warn("Basic Auth Realm was unquoted",
-                                      UserWarning, 2)
-                    if scheme.lower() == 'basic':
-                        return self.retry_http_basic_auth(host, req, realm)
+        unsupported = None
+        for header in headers:
+            for scheme, realm in self._parse_realm(header):
+                if scheme.lower() != 'basic':
+                    unsupported = scheme
+                    continue
+
+                if realm is not None:
+                    # Use the first matching Basic challenge.
+                    # Ignore following challenges even if they use the Basic
+                    # scheme.
+                    return self.retry_http_basic_auth(host, req, realm)
+
+        if unsupported is not None:
+            raise ValueError("AbstractBasicAuthHandler does not "
+                             "support the following scheme: %r"
+                             % (scheme,))
 
     def retry_http_basic_auth(self, host, req, realm):
         user, pw = self.passwd.find_user_password(realm, host)
@@ -1146,7 +1177,9 @@
                         req.selector)
         # NOTE: As per  RFC 2617, when server sends "auth,auth-int", the client could use either `auth`
         #     or `auth-int` to the response back. we use `auth` to send the response back.
-        if 'auth' in qop.split(','):
+        if qop is None:
+            respdig = KD(H(A1), "%s:%s" % (nonce, H(A2)))
+        elif 'auth' in qop.split(','):
             if nonce == self.last_nonce:
                 self.nonce_count += 1
             else:
@@ -1156,8 +1189,6 @@
             cnonce = self.get_cnonce(nonce)
             noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, 'auth', H(A2))
             respdig = KD(H(A1), noncebit)
-        elif qop is None:
-            respdig = KD(H(A1), "%s:%s" % (nonce, H(A2)))
         else:
             # XXX handle auth-int.
             raise URLError("qop '%s' is not supported." % qop)
diff --git a/Lib/venv/scripts/common/Activate.ps1 b/Lib/venv/scripts/common/Activate.ps1
index 98cb1b8..b8245b1 100644
--- a/Lib/venv/scripts/common/Activate.ps1
+++ b/Lib/venv/scripts/common/Activate.ps1
@@ -1,6 +1,6 @@
 <#
 .Synopsis
-Activate a Python virtual environment for the current Powershell session.
+Activate a Python virtual environment for the current PowerShell session.
 
 .Description
 Pushes the python executable for a virtual environment to the front of the
@@ -37,6 +37,15 @@
 and prefixes the current prompt with the specified string (surrounded in
 parentheses) while the virtual environment is active.
 
+.Notes
+On Windows, it may be required to enable this Activate.ps1 script by setting the
+execution policy for the user. You can do this by issuing the following PowerShell
+command:
+
+PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
+
+For more information on Execution Policies: 
+ttps:/go.microsoft.com/fwlink/?LinkID=135170
 
 #>
 Param(
@@ -137,7 +146,7 @@
                 $val = $keyval[1]
 
                 # Remove extraneous quotations around a string value.
-                if ("'""".Contains($val.Substring(0,1))) {
+                if ("'""".Contains($val.Substring(0, 1))) {
                     $val = $val.Substring(1, $val.Length - 2)
                 }
 
@@ -165,7 +174,8 @@
 # VenvExecDir if specified on the command line.
 if ($VenvDir) {
     Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
-} else {
+}
+else {
     Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
     $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
     Write-Verbose "VenvDir=$VenvDir"
@@ -179,7 +189,8 @@
 # just use the name of the virtual environment folder.
 if ($Prompt) {
     Write-Verbose "Prompt specified as argument, using '$Prompt'"
-} else {
+}
+else {
     Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
     if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
         Write-Verbose "  Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 1ef179a..9c73bcf 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -69,6 +69,14 @@
 # instead of "from webbrowser import *".
 
 def open(url, new=0, autoraise=True):
+    """Display url using the default browser.
+
+    If possible, open url in a location determined by new.
+    - 0: the same browser window (the default).
+    - 1: a new browser window.
+    - 2: a new browser page ("tab").
+    If possible, autoraise raises the window (the default) or not.
+    """
     if _tryorder is None:
         with _lock:
             if _tryorder is None:
@@ -80,9 +88,17 @@
     return False
 
 def open_new(url):
+    """Open url in a new window of the default browser.
+
+    If not possible, then open url in the only browser window.
+    """
     return open(url, 1)
 
 def open_new_tab(url):
+    """Open url in a new page ("tab") of the default browser.
+
+    If not possible, then the behavior becomes equivalent to open_new().
+    """
     return open(url, 2)
 
 
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 5dc6516..07faacc 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -17,7 +17,6 @@
 import threading
 import time
 import contextlib
-from collections import OrderedDict
 
 try:
     import zlib # We may need its compression method
@@ -2125,24 +2124,6 @@
         return (fname, archivename)
 
 
-def _unique_everseen(iterable, key=None):
-    "List unique elements, preserving order. Remember all elements ever seen."
-    # unique_everseen('AAAABBBCCDAABBB') --> A B C D
-    # unique_everseen('ABBCcAD', str.lower) --> A B C D
-    seen = set()
-    seen_add = seen.add
-    if key is None:
-        for element in itertools.filterfalse(seen.__contains__, iterable):
-            seen_add(element)
-            yield element
-    else:
-        for element in iterable:
-            k = key(element)
-            if k not in seen:
-                seen_add(k)
-                yield element
-
-
 def _parents(path):
     """
     Given a path with elements separated by
@@ -2184,6 +2165,18 @@
         path, tail = posixpath.split(path)
 
 
+_dedupe = dict.fromkeys
+"""Deduplicate an iterable in original order"""
+
+
+def _difference(minuend, subtrahend):
+    """
+    Return items in minuend not in subtrahend, retaining order
+    with O(1) lookup.
+    """
+    return itertools.filterfalse(set(subtrahend).__contains__, minuend)
+
+
 class CompleteDirs(ZipFile):
     """
     A ZipFile subclass that ensures that implied directories
@@ -2193,13 +2186,8 @@
     @staticmethod
     def _implied_dirs(names):
         parents = itertools.chain.from_iterable(map(_parents, names))
-        # Deduplicate entries in original order
-        implied_dirs = OrderedDict.fromkeys(
-            p + posixpath.sep for p in parents
-            # Cast names to a set for O(1) lookups
-            if p + posixpath.sep not in set(names)
-        )
-        return implied_dirs
+        as_dirs = (p + posixpath.sep for p in parents)
+        return _dedupe(_difference(as_dirs, names))
 
     def namelist(self):
         names = super(CompleteDirs, self).namelist()
diff --git a/METADATA b/METADATA
index 602a97a..c65415a 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@
     type: GIT
     value: "https://github.com/python/cpython"
   }
-  version: "v3.8.2"
+  version: "v3.8.3"
   license_type: NOTICE
   last_upgrade_date {
     year: 2020
-    month: 2
-    day: 25
+    month: 5
+    day: 13
   }
 }
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 0dd5364..0ad7298 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -215,9 +215,9 @@
 
     result.extend([
           dict(
-              name="OpenSSL 1.1.1d",
-              url="https://www.openssl.org/source/openssl-1.1.1d.tar.gz",
-              checksum='3be209000dbc7e1b95bcdf47980a3baa',
+              name="OpenSSL 1.1.1g",
+              url="https://www.openssl.org/source/openssl-1.1.1g.tar.gz",
+              checksum='76766e98997660138cdaf13a187bd234',
               buildrecipe=build_universal_openssl,
               configure=None,
               install=None,
@@ -313,9 +313,9 @@
                   ),
           ),
           dict(
-              name="SQLite 3.28.0",
-              url="https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz",
-              checksum='3c68eb400f8354605736cd55400e1572',
+              name="SQLite 3.31.1",
+              url="https://sqlite.org/2020/sqlite-autoconf-3310100.tar.gz",
+              checksum='2d0a553534c521504e3ac3ad3b90f125',
               extra_cflags=('-Os '
                             '-DSQLITE_ENABLE_FTS5 '
                             '-DSQLITE_ENABLE_FTS4 '
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
index 1d2db38..c8bd3ba 100644
--- a/Mac/Tools/pythonw.c
+++ b/Mac/Tools/pythonw.c
@@ -196,6 +196,15 @@
             }
         }
 
+        /*
+         * The environment variable is used to pass the value of real_path
+         * to the actual python interpreter, and is read by code in
+         * Python/coreconfig.c.
+         *
+         * This way the real interpreter knows how the user invoked the
+         * interpreter and can behave as if this launcher is the real
+         * interpreter (looking for pyvenv configuration, ...)
+         */
         setenv("__PYVENV_LAUNCHER__", real_path, 1);
     }
 
diff --git a/Misc/ACKS b/Misc/ACKS
index 8fd4df5..34a6fc4 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -38,6 +38,7 @@
 Billy G. Allie
 Jamiel Almeida
 Kevin Altis
+Samy Lahfa
 Skyler Leigh Amador
 Joe Amenta
 Rose Ames
@@ -362,6 +363,7 @@
 Raúl Cumplido
 Antonio Cuni
 Brian Curtin
+Hakan Celik
 Paul Dagnelie
 Lisandro Dalcin
 Darren Dale
@@ -410,6 +412,7 @@
 Jaromir Dolecek
 Zsolt Dollenstein
 Brendan Donegan
+Peter Donis
 Ismail Donmez
 Ray Donnelly
 Robert Donohue
@@ -766,6 +769,7 @@
 David Jacobs
 Kevin Jacobs
 Kjetil Jacobsen
+Shantanu Jain
 Bertrand Janin
 Geert Jansen
 Jack Jansen
diff --git a/Misc/NEWS.d/3.8.3.rst b/Misc/NEWS.d/3.8.3.rst
new file mode 100644
index 0000000..39a4417
--- /dev/null
+++ b/Misc/NEWS.d/3.8.3.rst
@@ -0,0 +1,107 @@
+.. bpo: 40527
+.. date: 2020-05-06-14-52-35
+.. nonce: gTNKuy
+.. release date: 2020-05-13
+.. section: Core and Builtins
+
+Fix command line argument parsing: no longer write errors multiple times
+into stderr.
+
+..
+
+.. bpo: 40417
+.. date: 2020-05-01-19-04-52
+.. nonce: Sti2lJ
+.. section: Core and Builtins
+
+Fix imp module deprecation warning when PyImport_ReloadModule is called.
+Patch by Robert Rouhani.
+
+..
+
+.. bpo: 39562
+.. date: 2020-05-01-14-58-16
+.. nonce: KCsX8n
+.. section: Core and Builtins
+
+The constant values of future flags in the :mod:`__future__` module are
+updated in order to prevent collision with compiler flags. Previously
+``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``.
+
+..
+
+.. bpo: 40559
+.. date: 2020-05-05-08-12-51
+.. nonce: 112wwa
+.. section: Library
+
+Fix possible memory leak in the C implementation of :class:`asyncio.Task`.
+
+..
+
+.. bpo: 40355
+.. date: 2020-05-02-14-24-48
+.. nonce: xTujaB
+.. section: Library
+
+Improve error reporting in :func:`ast.literal_eval` in the presence of
+malformed :class:`ast.Dict` nodes instead of silently ignoring any
+non-conforming elements. Patch by Curtis Bucher.
+
+..
+
+.. bpo: 40459
+.. date: 2020-05-02-04-29-31
+.. nonce: fSAYVD
+.. section: Library
+
+:func:`platform.win32_ver` now produces correct *ptype* strings instead of
+empty strings.
+
+..
+
+.. bpo: 40398
+.. date: 2020-04-26-22-25-36
+.. nonce: OdXnR3
+.. section: Library
+
+:func:`typing.get_args` now always returns an empty tuple for special
+generic aliases.
+
+..
+
+.. bpo: 40561
+.. date: 2020-05-08-08-39-40
+.. nonce: ZMB_2i
+.. section: Documentation
+
+Provide docstrings for webbrowser open functions.
+
+..
+
+.. bpo: 39435
+.. date: 2020-01-24-05-42-57
+.. nonce: EFcdFU
+.. section: Documentation
+
+Fix an incorrect signature for :func:`pickle.loads` in the docs
+
+..
+
+.. bpo: 40458
+.. date: 2020-05-01-20-57-57
+.. nonce: Eb0ueI
+.. section: Windows
+
+Increase reserved stack space to prevent overflow crash on Windows.
+
+..
+
+.. bpo: 40412
+.. date: 2020-05-01-17-28-04
+.. nonce: dE0D8N
+.. section: C API
+
+Nullify inittab_copy during finalization, preventing future interpreter
+initializations in an embedded situation from crashing. Patch by Gregory
+Szorc.
diff --git a/Misc/NEWS.d/3.8.3rc1.rst b/Misc/NEWS.d/3.8.3rc1.rst
new file mode 100644
index 0000000..f07bf90
--- /dev/null
+++ b/Misc/NEWS.d/3.8.3rc1.rst
@@ -0,0 +1,884 @@
+.. bpo: 40121
+.. date: 2020-03-30-23-16-25
+.. nonce: p2LIio
+.. release date: 2020-04-29
+.. section: Security
+
+Fixes audit events raised on creating a new socket.
+
+..
+
+.. bpo: 38576
+.. date: 2020-03-14-14-57-44
+.. nonce: OowwQn
+.. section: Security
+
+Disallow control characters in hostnames in http.client, addressing
+CVE-2019-18348. Such potentially malicious header injection URLs now cause a
+InvalidURL to be raised.
+
+..
+
+.. bpo: 39503
+.. date: 2020-01-30-16-15-29
+.. nonce: B299Yq
+.. section: Security
+
+CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class
+of the :mod:`urllib.request` module uses an inefficient regular expression
+which can be exploited by an attacker to cause a denial of service. Fix the
+regex to prevent the catastrophic backtracking. Vulnerability reported by
+Ben Caller and Matt Schwager.
+
+..
+
+.. bpo: 20526
+.. date: 2020-03-23-18-08-34
+.. nonce: NHNZIv
+.. section: Core and Builtins
+
+Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is a borrowed
+reference, not a strong reference: ``PyThreadState_Clear()`` must not call
+``Py_CLEAR(tstate->frame)``.
+
+..
+
+.. bpo: 39965
+.. date: 2020-03-15-03-52-01
+.. nonce: Od3ZdP
+.. section: Core and Builtins
+
+Correctly raise ``SyntaxError`` if *await* is used inside non-async
+functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the asyncio
+REPL). Patch by Pablo Galindo.
+
+..
+
+.. bpo: 39562
+.. date: 2020-03-12-22-13-50
+.. nonce: E2u273
+.. section: Core and Builtins
+
+Allow executing asynchronous comprehensions on the top level when the
+``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan Taskaya.
+
+..
+
+.. bpo: 38894
+.. date: 2020-03-06-21-04-39
+.. nonce: nfcGKv
+.. section: Core and Builtins
+
+Fix a bug that was causing incomplete results when calling
+``pathlib.Path.glob`` in the presence of symlinks that point to files where
+the user does not have read access. Patch by Pablo Galindo and Matt
+Wozniski.
+
+..
+
+.. bpo: 39871
+.. date: 2020-03-06-06-12-37
+.. nonce: dCAj_2
+.. section: Core and Builtins
+
+Fix a possible :exc:`SystemError` in ``math.{atan2,copysign,remainder}()``
+when the first argument cannot be converted to a :class:`float`. Patch by
+Zachary Spytz.
+
+..
+
+.. bpo: 39776
+.. date: 2020-03-02-20-12-33
+.. nonce: fNaxi_
+.. section: Core and Builtins
+
+Fix race condition where threads created by PyGILState_Ensure() could get a
+duplicate id.
+
+This affects consumers of tstate->id like the contextvar caching machinery,
+which could return invalid cached objects under heavy thread load (observed
+in embedded scenarios).
+
+..
+
+.. bpo: 39778
+.. date: 2020-03-02-19-21-21
+.. nonce: _YGLEc
+.. section: Core and Builtins
+
+Fixed a crash due to incorrect handling of weak references in
+``collections.OrderedDict`` classes. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 39520
+.. date: 2020-02-02-00-12-07
+.. nonce: uicBq6
+.. section: Core and Builtins
+
+Fix unparsing of ext slices with no items (``foo[:,]``). Patch by Batuhan
+Taskaya.
+
+..
+
+.. bpo: 22490
+.. date: 2018-09-23-16-32-58
+.. nonce: 8e0YDf
+.. section: Core and Builtins
+
+Don't leak environment variable ``__PYVENV_LAUNCHER__`` into the interpreter
+session on macOS.
+
+..
+
+.. bpo: 40138
+.. date: 2020-04-22-00-05-10
+.. nonce: i_oGqa
+.. section: Library
+
+Fix the Windows implementation of :func:`os.waitpid` for exit code larger
+than ``INT_MAX >> 8``. The exit status is now interpreted as an unsigned
+number.
+
+..
+
+.. bpo: 39942
+.. date: 2020-04-20-20-16-02
+.. nonce: NvGnTc
+.. section: Library
+
+Set "__main__" as the default module name when "__name__" is missing in
+:class:`typing.TypeVar`. Patch by Weipeng Hong.
+
+..
+
+.. bpo: 40330
+.. date: 2020-04-19-17-31-29
+.. nonce: DGjoIS
+.. section: Library
+
+In :meth:`ShareableList.__setitem__`, check the size of a new string item
+after encoding it to utf-8, not before.
+
+..
+
+.. bpo: 40287
+.. date: 2020-04-15-17-21-48
+.. nonce: -mkEJH
+.. section: Library
+
+Fixed ``SpooledTemporaryFile.seek()`` to return the position.
+
+..
+
+.. bpo: 40260
+.. date: 2020-04-12-21-18-56
+.. nonce: F6VWaE
+.. section: Library
+
+Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding
+comments.
+
+..
+
+.. bpo: 40196
+.. date: 2020-04-06-11-05-13
+.. nonce: Jqowse
+.. section: Library
+
+Fix a bug in the :mod:`symtable` module that was causing incorrectly report
+global variables as local. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 40126
+.. date: 2020-04-04-00-47-40
+.. nonce: Y-bTNP
+.. section: Library
+
+Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()``
+is now never called if its ``__enter__()`` is failed. Returning true from
+``__exit__()`` silences now the exception.
+
+..
+
+.. bpo: 40089
+.. date: 2020-03-27-17-22-34
+.. nonce: -lFsD0
+.. section: Library
+
+Fix threading._after_fork(): if fork was not called by a thread spawned by
+threading.Thread, threading._after_fork() now creates a _MainThread instance
+for _main_thread, instead of a _DummyThread instance.
+
+..
+
+.. bpo: 39503
+.. date: 2020-03-25-16-02-16
+.. nonce: YmMbYn
+.. section: Library
+
+:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request`
+now parses all WWW-Authenticate HTTP headers and accepts multiple challenges
+per header: use the realm of the first Basic challenge.
+
+..
+
+.. bpo: 40014
+.. date: 2020-03-23-17-52-00
+.. nonce: Ya70VG
+.. section: Library
+
+Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails because the
+group list is too small, retry with a larger group list. On failure, the
+glibc implementation of ``getgrouplist()`` sets ``ngroups`` to the total
+number of groups. For other implementations, double the group list size.
+
+..
+
+.. bpo: 40016
+.. date: 2020-03-19-19-40-27
+.. nonce: JWtxqJ
+.. section: Library
+
+In re docstring, clarify the relationship between inline and argument
+compile flags.
+
+..
+
+.. bpo: 39953
+.. date: 2020-03-19-16-33-03
+.. nonce: yy5lC_
+.. section: Library
+
+Update internal table of OpenSSL error codes in the ``ssl`` module.
+
+..
+
+.. bpo: 39360
+.. date: 2020-03-15-05-41-05
+.. nonce: cmcU5p
+.. section: Library
+
+Ensure all workers exit when finalizing a :class:`multiprocessing.Pool`
+implicitly via the module finalization handlers of multiprocessing. This
+fixes a deadlock situation that can be experienced when the Pool is not
+properly finalized via the context manager or a call to
+``multiprocessing.Pool.terminate``. Patch by Batuhan Taskaya and Pablo
+Galindo.
+
+..
+
+.. bpo: 39652
+.. date: 2020-03-11-23-08-25
+.. nonce: gbasrk
+.. section: Library
+
+The column name found in ``sqlite3.Cursor.description`` is now truncated on
+the first '[' only if the PARSE_COLNAMES option is set.
+
+..
+
+.. bpo: 39915
+.. date: 2020-03-10-19-38-47
+.. nonce: CjPeiY
+.. section: Library
+
+Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call objects in
+the order of awaited arguments instead of using
+:attr:`unittest.mock.Mock.call_args` which has the last value of the call.
+Patch by Karthikeyan Singaravelan.
+
+..
+
+.. bpo: 38662
+.. date: 2020-03-10-15-32-31
+.. nonce: o1DMXj
+.. section: Library
+
+The ``ensurepip`` module now invokes ``pip`` via the ``runpy`` module. Hence
+it is no longer tightly coupled with the internal API of the bundled ``pip``
+version, allowing easier updates to a newer ``pip`` version both internally
+and for distributors.
+
+..
+
+.. bpo: 39916
+.. date: 2020-03-09-18-56-27
+.. nonce: BHHyp3
+.. section: Library
+
+More reliable use of ``os.scandir()`` in ``Path.glob()``. It no longer emits
+a ResourceWarning when interrupted.
+
+..
+
+.. bpo: 39850
+.. date: 2020-03-09-01-45-06
+.. nonce: eaJNIE
+.. section: Library
+
+:mod:`multiprocessing` now supports abstract socket addresses (if abstract
+sockets are supported in the running platform). Patch by Pablo Galindo.
+
+..
+
+.. bpo: 39828
+.. date: 2020-03-05-00-57-49
+.. nonce: yWq9NJ
+.. section: Library
+
+Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by Dong-hee Na.
+
+..
+
+.. bpo: 13487
+.. date: 2020-03-04-16-10-59
+.. nonce: gqe4Fb
+.. section: Library
+
+Avoid a possible *"RuntimeError: dictionary changed size during iteration"*
+from :func:`inspect.getmodule` when it tried to loop through
+:attr:`sys.modules`.
+
+..
+
+.. bpo: 39794
+.. date: 2020-02-29-19-17-39
+.. nonce: 7VjatS
+.. section: Library
+
+Add --without-decimal-contextvar build option.  This enables a thread-local
+rather than a coroutine local context.
+
+..
+
+.. bpo: 39769
+.. date: 2020-02-29-13-20-33
+.. nonce: hJmxu4
+.. section: Library
+
+The :func:`compileall.compile_dir` function's *ddir* parameter and the
+compileall command line flag `-d` no longer write the wrong pathname to the
+generated pyc file for submodules beneath the root of the directory tree
+being compiled.  This fixes a regression introduced with Python 3.5.
+
+..
+
+.. bpo: 39517
+.. date: 2020-02-29-11-20-50
+.. nonce: voQZb8
+.. section: Library
+
+Fix runpy.run_path() when using pathlike objects
+
+..
+
+.. bpo: 39764
+.. date: 2020-02-27-18-21-07
+.. nonce: wqPk68
+.. section: Library
+
+Fix AttributeError when calling get_stack on a PyAsyncGenObject Task
+
+..
+
+.. bpo: 30566
+.. date: 2020-02-24-03-45-28
+.. nonce: qROxty
+.. section: Library
+
+Fix :exc:`IndexError` when trying to decode an invalid string with punycode
+codec.
+
+..
+
+.. bpo: 39667
+.. date: 2020-02-17-22-38-15
+.. nonce: QuzEHH
+.. section: Library
+
+Correct performance degradation in ``zipfile.Path`` as found in zipp 3.0.
+While retaining compatibility, this change discourages the use of
+``zipfile.Path.open`` due to the signature change in Python 3.9. For
+compatibility across Python 3.8 and later versions, consider using
+``zipp.Path`` on Python 3.8.x and earlier.
+
+..
+
+.. bpo: 39548
+.. date: 2020-02-06-05-33-52
+.. nonce: DF4FFe
+.. section: Library
+
+Fix handling of header in :class:`urllib.request.AbstractDigestAuthHandler`
+when the optional ``qop`` parameter is not present.
+
+..
+
+.. bpo: 38971
+.. date: 2019-12-20-16-06-28
+.. nonce: fKRYlF
+.. section: Library
+
+Open issue in the BPO indicated a desire to make the implementation of
+codecs.open() at parity with io.open(), which implements a try/except to
+assure file stream gets closed before an exception is raised.
+
+..
+
+.. bpo: 38410
+.. date: 2019-10-09-08-14-25
+.. nonce: _YyoMV
+.. section: Library
+
+Properly handle :func:`sys.audit` failures in
+:func:`sys.set_asyncgen_hooks`. Based on patch by Zackery Spytz.
+
+..
+
+.. bpo: 36541
+.. date: 2019-06-18-19-38-27
+.. nonce: XI8mi1
+.. section: Library
+
+lib2to3 now recognizes named assignment expressions (the walrus operator,
+``:=``)
+
+..
+
+.. bpo: 31758
+.. date: 2017-10-14-21-02-40
+.. nonce: 563ZZb
+.. section: Library
+
+Prevent crashes when using an uninitialized ``_elementtree.XMLParser``
+object. Patch by Oren Milman.
+
+..
+
+.. bpo: 27635
+.. date: 2020-04-01-00-27-03
+.. nonce: VwxUty
+.. section: Documentation
+
+The pickle documentation incorrectly claimed that ``__new__`` isn't called
+by default when unpickling.
+
+..
+
+.. bpo: 39879
+.. date: 2020-03-16-18-12-02
+.. nonce: CnQ7Cv
+.. section: Documentation
+
+Updated :ref:`datamodel` docs to include :func:`dict` insertion order
+preservation. Patch by Furkan Onder and Samy Lahfa.
+
+..
+
+.. bpo: 39868
+.. date: 2020-03-05-16-29-03
+.. nonce: JQoHhO
+.. section: Documentation
+
+Updated the Language Reference for :pep:`572`.
+
+..
+
+.. bpo: 13790
+.. date: 2020-02-28-14-39-25
+.. nonce: hvLaRI
+.. section: Documentation
+
+Change 'string' to 'specification' in format doc.
+
+..
+
+.. bpo: 17422
+.. date: 2020-02-27-17-35-27
+.. nonce: eS1hVh
+.. section: Documentation
+
+The language reference no longer restricts default class namespaces to dicts
+only.
+
+..
+
+.. bpo: 39530
+.. date: 2020-02-23-13-26-40
+.. nonce: _bCvzQ
+.. section: Documentation
+
+Fix misleading documentation about mixed-type numeric comparisons.
+
+..
+
+.. bpo: 39718
+.. date: 2020-02-21-22-05-20
+.. nonce: xtBoSi
+.. section: Documentation
+
+Update :mod:`token` documentation to reflect additions in Python 3.8
+
+..
+
+.. bpo: 39677
+.. date: 2020-02-18-14-28-31
+.. nonce: vNHqoX
+.. section: Documentation
+
+Changed operand name of **MAKE_FUNCTION** from *argc* to *flags* for module
+:mod:`dis`
+
+..
+
+.. bpo: 38387
+.. date: 2019-10-06-23-44-15
+.. nonce: fZoq0S
+.. section: Documentation
+
+Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference.
+
+..
+
+.. bpo: 40436
+.. date: 2020-04-29-16-08-24
+.. nonce: gDMnYl
+.. section: Tests
+
+test_gdb and test.pythoninfo now check gdb command exit code.
+
+..
+
+.. bpo: 40162
+.. date: 2020-04-03-02-40-16
+.. nonce: v3pQW_
+.. section: Tests
+
+Update Travis CI configuration to OpenSSL 1.1.1f.
+
+..
+
+.. bpo: 40146
+.. date: 2020-04-02-02-14-37
+.. nonce: J-Yo9G
+.. section: Tests
+
+Update OpenSSL to 1.1.1f in Azure Pipelines.
+
+..
+
+.. bpo: 40019
+.. date: 2020-03-20-00-30-36
+.. nonce: zOqHpQ
+.. section: Tests
+
+test_gdb now skips tests if it detects that gdb failed to read debug
+information because the Python binary is optimized.
+
+..
+
+.. bpo: 27807
+.. date: 2020-03-18-16-04-33
+.. nonce: 9gKjET
+.. section: Tests
+
+``test_site.test_startup_imports()`` is now skipped if a path of
+:data:`sys.path` contains a ``.pth`` file.
+
+..
+
+.. bpo: 39793
+.. date: 2020-02-29-12-58-17
+.. nonce: Og2SUN
+.. section: Tests
+
+Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya.
+
+..
+
+.. bpo: 1812
+.. date: 2019-11-25-21-46-47
+.. nonce: sAbTbY
+.. section: Tests
+
+Fix newline handling in doctest.testfile when loading from a package whose
+loader has a get_data method. Patch by Peter Donis.
+
+..
+
+.. bpo: 37957
+.. date: 2019-10-30-00-01-43
+.. nonce: X1r78F
+.. section: Tests
+
+test.regrtest now can receive a list of test patterns to ignore (using the
+-i/--ignore argument) or a file with a list of patterns to ignore (using the
+--ignore-file argument). Patch by Pablo Galindo.
+
+..
+
+.. bpo: 38502
+.. date: 2019-10-17-00-49-38
+.. nonce: vUEic7
+.. section: Tests
+
+test.regrtest now uses process groups in the multiprocessing mode (-jN
+command line option) if process groups are available: if :func:`os.setsid`
+and :func:`os.killpg` functions are available.
+
+..
+
+.. bpo: 38360
+.. date: 2020-04-22-02-33-54
+.. nonce: 74C68u
+.. section: Build
+
+Support single-argument form of macOS -isysroot flag.
+
+..
+
+.. bpo: 40204
+.. date: 2020-04-09-00-19-10
+.. nonce: K-S6RZ
+.. section: Build
+
+Pin Sphinx version to 1.8.2 in ``Doc/Makefile``.
+
+..
+
+.. bpo: 40158
+.. date: 2020-04-03-17-54-33
+.. nonce: MWUTs4
+.. section: Build
+
+Fix CPython MSBuild Properties in NuGet Package (build/native/python.props)
+
+..
+
+.. bpo: 38527
+.. date: 2020-03-28-10-43-09
+.. nonce: fqCRgD
+.. section: Build
+
+Fix configure check on Solaris for "float word ordering": sometimes, the
+correct "grep" command was not being used. Patch by Arnon Yaari.
+
+..
+
+.. bpo: 40164
+.. date: 2020-04-04-13-13-44
+.. nonce: SPrSn5
+.. section: Windows
+
+Updates Windows to OpenSSL 1.1.1f
+
+..
+
+.. bpo: 39930
+.. date: 2020-03-11-10-15-56
+.. nonce: LGHw1j
+.. section: Windows
+
+Ensures the required :file:`vcruntime140.dll` is included in install
+packages.
+
+..
+
+.. bpo: 39847
+.. date: 2020-03-04-17-05-11
+.. nonce: C3N2m3
+.. section: Windows
+
+Avoid hang when computer is hibernated whilst waiting for a mutex (for
+lock-related objects from :mod:`threading`) around 49-day uptime.
+
+..
+
+.. bpo: 38597
+.. date: 2020-03-01-15-04-54
+.. nonce: MnHdYl
+.. section: Windows
+
+:mod:`distutils` will no longer statically link :file:`vcruntime140.dll`
+when a redistributable version is unavailable. All future releases of
+CPython will include a copy of this DLL to ensure distributed extensions can
+continue to load.
+
+..
+
+.. bpo: 38380
+.. date: 2020-02-28-23-51-27
+.. nonce: TpOBCj
+.. section: Windows
+
+Update Windows builds to use SQLite 3.31.1
+
+..
+
+.. bpo: 39789
+.. date: 2020-02-28-22-46-09
+.. nonce: 67XRoP
+.. section: Windows
+
+Update Windows release build machines to Visual Studio 2019 (MSVC 14.2).
+
+..
+
+.. bpo: 34803
+.. date: 2020-02-25-18-43-34
+.. nonce: S3VcS0
+.. section: Windows
+
+Package for nuget.org now includes repository reference and bundled icon
+image.
+
+..
+
+.. bpo: 40164
+.. date: 2020-04-21-19-46-35
+.. nonce: 6HA6IC
+.. section: macOS
+
+Update macOS installer builds to use OpenSSL 1.1.1g.
+
+..
+
+.. bpo: 38380
+.. date: 2020-02-28-23-51-47
+.. nonce: u-ySyA
+.. section: macOS
+
+Update macOS builds to use SQLite 3.31.1
+
+..
+
+.. bpo: 27115
+.. date: 2020-03-09-02-45-12
+.. nonce: 8hSHMo
+.. section: IDLE
+
+For 'Go to Line', use a Query box subclass with IDLE standard behavior and
+improved error checking.
+
+..
+
+.. bpo: 39885
+.. date: 2020-03-08-14-27-36
+.. nonce: 29ERiR
+.. section: IDLE
+
+Since clicking to get an IDLE context menu moves the cursor, any text
+selection should be and now is cleared.
+
+..
+
+.. bpo: 39852
+.. date: 2020-03-06-01-55-14
+.. nonce: QjA1qF
+.. section: IDLE
+
+Edit "Go to line" now clears any selection, preventing accidental deletion.
+It also updates Ln and Col on the status bar.
+
+..
+
+.. bpo: 39781
+.. date: 2020-02-27-22-17-09
+.. nonce: bbYBeL
+.. section: IDLE
+
+Selecting code context lines no longer causes a jump.
+
+..
+
+.. bpo: 38439
+.. date: 2019-12-05-14-20-53
+.. nonce: j_L2PI
+.. section: IDLE
+
+Add a 256×256 pixel IDLE icon to support more modern environments. Created
+by Andrew Clover. Delete the unused macOS idle.icns icon file.
+
+..
+
+.. bpo: 38689
+.. date: 2019-11-14-12-59-19
+.. nonce: Lgfxva
+.. section: IDLE
+
+IDLE will no longer freeze when inspect.signature fails when fetching a
+calltip.
+
+..
+
+.. bpo: 40179
+.. date: 2020-04-04-19-35-22
+.. nonce: u9FH10
+.. section: Tools/Demos
+
+Fixed translation of ``#elif`` in Argument Clinic.
+
+..
+
+.. bpo: 36184
+.. date: 2020-03-09-13-28-13
+.. nonce: BMPJ0D
+.. section: Tools/Demos
+
+Port python-gdb.py to FreeBSD. python-gdb.py now checks for "take_gil"
+function name to check if a frame tries to acquire the GIL, instead of
+checking for "pthread_cond_timedwait" which is specific to Linux and can be
+a different condition than the GIL.
+
+..
+
+.. bpo: 39889
+.. date: 2020-03-07-18-01-30
+.. nonce: l1czT6
+.. section: Tools/Demos
+
+Fixed ``unparse.py`` for extended slices containing a single element (e.g.
+``a[i:j,]``). Remove redundant tuples when index with a tuple (e.g. ``a[i,
+j]``).
+
+..
+
+.. bpo: 35370
+.. date: 2020-03-13-16-44-23
+.. nonce: sXRA-r
+.. section: C API
+
+If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile` or
+:c:func:`PyEval_SetTrace`, log the error as an unraisable exception.
+
+..
+
+.. bpo: 39884
+.. date: 2020-03-12-00-27-26
+.. nonce: CGOJBO
+.. section: C API
+
+:c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now include the
+method name in the SystemError "bad call flags" error message to ease debug.
+
+..
+
+.. bpo: 38643
+.. date: 2020-03-08-22-56-22
+.. nonce: k2ixx6
+.. section: C API
+
+:c:func:`PyNumber_ToBase` now raises a :exc:`SystemError` instead of
+crashing when called with invalid base.
+
+..
+
+.. bpo: 38913
+.. date: 2020-02-25-20-10-34
+.. nonce: siF1lS
+.. section: C API
+
+Fixed segfault in ``Py_BuildValue()`` called with a format containing "#"
+and undefined PY_SSIZE_T_CLEAN whwn an exception is set.
diff --git a/Misc/gdbinit b/Misc/gdbinit
index 45e79fc..e8f62ba 100644
--- a/Misc/gdbinit
+++ b/Misc/gdbinit
@@ -160,7 +160,7 @@
   Print the entire Python call stack - verbose mode
 end
 
-def pu
+define pu
   set $uni = $arg0
   set $i = 0
   while (*$uni && $i++<100)
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index f4efa21..8e1cd4f 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -2626,6 +2626,10 @@
     coro = task->task_coro;
     if (coro == NULL) {
         PyErr_SetString(PyExc_RuntimeError, "uninitialized Task object");
+        if (clear_exc) {
+            /* We created 'exc' during this call */
+            Py_DECREF(exc);
+        }
         return NULL;
     }
 
@@ -3261,6 +3265,8 @@
     Py_CLEAR(context_kwname);
 
     module_free_freelists();
+
+    module_initialized = 0;
 }
 
 static int
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index e2ac198..df7c6e2 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -122,7 +122,14 @@
 }
 
 
-static PyObject *current_context_var;
+#ifndef WITH_DECIMAL_CONTEXTVAR
+/* Key for thread state dictionary */
+static PyObject *tls_context_key = NULL;
+/* Invariant: NULL or the most recently accessed thread local context */
+static PyDecContextObject *cached_context = NULL;
+#else
+static PyObject *current_context_var = NULL;
+#endif
 
 /* Template for creating new thread contexts, calling Context() without
  * arguments and initializing the module_context on first access. */
@@ -1217,6 +1224,12 @@
 static void
 context_dealloc(PyDecContextObject *self)
 {
+#ifndef WITH_DECIMAL_CONTEXTVAR
+    if (self == cached_context) {
+        cached_context = NULL;
+    }
+#endif
+
     Py_XDECREF(self->traps);
     Py_XDECREF(self->flags);
     Py_TYPE(self)->tp_free(self);
@@ -1491,6 +1504,134 @@
  * operation.
  */
 
+#ifndef WITH_DECIMAL_CONTEXTVAR
+/* Get the context from the thread state dictionary. */
+static PyObject *
+current_context_from_dict(void)
+{
+    PyObject *dict;
+    PyObject *tl_context;
+    PyThreadState *tstate;
+
+    dict = PyThreadState_GetDict();
+    if (dict == NULL) {
+        PyErr_SetString(PyExc_RuntimeError,
+            "cannot get thread state");
+        return NULL;
+    }
+
+    tl_context = PyDict_GetItemWithError(dict, tls_context_key);
+    if (tl_context != NULL) {
+        /* We already have a thread local context. */
+        CONTEXT_CHECK(tl_context);
+    }
+    else {
+        if (PyErr_Occurred()) {
+            return NULL;
+        }
+
+        /* Set up a new thread local context. */
+        tl_context = context_copy(default_context_template, NULL);
+        if (tl_context == NULL) {
+            return NULL;
+        }
+        CTX(tl_context)->status = 0;
+
+        if (PyDict_SetItem(dict, tls_context_key, tl_context) < 0) {
+            Py_DECREF(tl_context);
+            return NULL;
+        }
+        Py_DECREF(tl_context);
+    }
+
+    /* Cache the context of the current thread, assuming that it
+     * will be accessed several times before a thread switch. */
+    tstate = PyThreadState_GET();
+    if (tstate) {
+        cached_context = (PyDecContextObject *)tl_context;
+        cached_context->tstate = tstate;
+    }
+
+    /* Borrowed reference with refcount==1 */
+    return tl_context;
+}
+
+/* Return borrowed reference to thread local context. */
+static PyObject *
+current_context(void)
+{
+    PyThreadState *tstate;
+
+    tstate = PyThreadState_GET();
+    if (cached_context && cached_context->tstate == tstate) {
+        return (PyObject *)cached_context;
+    }
+
+    return current_context_from_dict();
+}
+
+/* ctxobj := borrowed reference to the current context */
+#define CURRENT_CONTEXT(ctxobj) \
+    ctxobj = current_context(); \
+    if (ctxobj == NULL) {       \
+        return NULL;            \
+    }
+
+/* Return a new reference to the current context */
+static PyObject *
+PyDec_GetCurrentContext(PyObject *self UNUSED, PyObject *args UNUSED)
+{
+    PyObject *context;
+
+    context = current_context();
+    if (context == NULL) {
+        return NULL;
+    }
+
+    Py_INCREF(context);
+    return context;
+}
+
+/* Set the thread local context to a new context, decrement old reference */
+static PyObject *
+PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
+{
+    PyObject *dict;
+
+    CONTEXT_CHECK(v);
+
+    dict = PyThreadState_GetDict();
+    if (dict == NULL) {
+        PyErr_SetString(PyExc_RuntimeError,
+            "cannot get thread state");
+        return NULL;
+    }
+
+    /* If the new context is one of the templates, make a copy.
+     * This is the current behavior of decimal.py. */
+    if (v == default_context_template ||
+        v == basic_context_template ||
+        v == extended_context_template) {
+        v = context_copy(v, NULL);
+        if (v == NULL) {
+            return NULL;
+        }
+        CTX(v)->status = 0;
+    }
+    else {
+        Py_INCREF(v);
+    }
+
+    cached_context = NULL;
+    if (PyDict_SetItem(dict, tls_context_key, v) < 0) {
+        Py_DECREF(v);
+        return NULL;
+    }
+
+    Py_DECREF(v);
+    Py_RETURN_NONE;
+}
+#else
 static PyObject *
 init_current_context(void)
 {
@@ -1570,6 +1711,7 @@
 
     Py_RETURN_NONE;
 }
+#endif
 
 /* Context manager object for the 'with' statement. The manager
  * owns one reference to the global (outer) context and one
@@ -4388,15 +4530,8 @@
     mpd_ssize_t exp;
     uint32_t status = 0;
     mpd_context_t maxctx;
-    PyObject *context;
 
 
-    context = current_context();
-    if (context == NULL) {
-        return -1;
-    }
-    Py_DECREF(context);
-
     if (mpd_isspecial(MPD(v))) {
         if (mpd_issnan(MPD(v))) {
             PyErr_SetString(PyExc_TypeError,
@@ -5538,11 +5673,6 @@
     mpd_free = PyMem_Free;
     mpd_setminalloc(_Py_DEC_MINALLOC);
 
-    /* Init context variable */
-    current_context_var = PyContextVar_New("decimal_context", NULL);
-    if (current_context_var == NULL) {
-        goto error;
-    }
 
     /* Init external C-API functions */
     _py_long_multiply = PyLong_Type.tp_as_number->nb_multiply;
@@ -5714,6 +5844,15 @@
     CHECK_INT(PyModule_AddObject(m, "DefaultContext",
                                  default_context_template));
 
+#ifndef WITH_DECIMAL_CONTEXTVAR
+    ASSIGN_PTR(tls_context_key, PyUnicode_FromString("___DECIMAL_CTX__"));
+    Py_INCREF(Py_False);
+    CHECK_INT(PyModule_AddObject(m, "HAVE_CONTEXTVAR", Py_False));
+#else
+    ASSIGN_PTR(current_context_var, PyContextVar_New("decimal_context", NULL));
+    Py_INCREF(Py_True);
+    CHECK_INT(PyModule_AddObject(m, "HAVE_CONTEXTVAR", Py_True));
+#endif
     Py_INCREF(Py_True);
     CHECK_INT(PyModule_AddObject(m, "HAVE_THREADS", Py_True));
 
@@ -5773,9 +5912,13 @@
     Py_CLEAR(SignalTuple); /* GCOV_NOT_REACHED */
     Py_CLEAR(DecimalTuple); /* GCOV_NOT_REACHED */
     Py_CLEAR(default_context_template); /* GCOV_NOT_REACHED */
+#ifndef WITH_DECIMAL_CONTEXTVAR
+    Py_CLEAR(tls_context_key); /* GCOV_NOT_REACHED */
+#else
+    Py_CLEAR(current_context_var); /* GCOV_NOT_REACHED */
+#endif
     Py_CLEAR(basic_context_template); /* GCOV_NOT_REACHED */
     Py_CLEAR(extended_context_template); /* GCOV_NOT_REACHED */
-    Py_CLEAR(current_context_var); /* GCOV_NOT_REACHED */
     Py_CLEAR(m); /* GCOV_NOT_REACHED */
 
     return NULL; /* GCOV_NOT_REACHED */
diff --git a/Modules/_decimal/tests/runall-memorydebugger.sh b/Modules/_decimal/tests/runall-memorydebugger.sh
index 29b7723..7f3e527 100755
--- a/Modules/_decimal/tests/runall-memorydebugger.sh
+++ b/Modules/_decimal/tests/runall-memorydebugger.sh
@@ -1,8 +1,8 @@
 #!/bin/sh
 
 #
-# Purpose: test all machine configurations, pydebug, refleaks, release build
-#          and release build with valgrind.
+# Purpose: test with and without contextvar, all machine configurations, pydebug,
+#          refleaks, release build and release build with valgrind.
 #
 # Synopsis: ./runall-memorydebugger.sh [--all-configs64 | --all-configs32]
 #
@@ -57,7 +57,8 @@
 cd ..
 
 # test_decimal: refleak, regular and Valgrind tests
-for config in $CONFIGS; do
+for args in "--without-decimal-contextvar" ""; do
+    for config in $CONFIGS; do
 
         unset PYTHON_DECIMAL_WITH_MACHINE
         libmpdec_config=$config
@@ -69,12 +70,12 @@
         fi
 
         ############ refleak tests ###########
-        print_config "refleak tests: config=$config"
+        print_config "refleak tests: config=$config" $args
         printf "\nbuilding python ...\n\n"
 
         cd ../../
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ======================== refleak tests ===========================\n\n"
@@ -82,11 +83,11 @@
 
 
         ############ regular tests ###########
-        print_config "regular tests: config=$config"
+        print_config "regular tests: config=$config" $args
         printf "\nbuilding python ...\n\n"
 
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ======================== regular tests ===========================\n\n"
@@ -103,21 +104,23 @@
                   esac
         esac
 
-        print_config "valgrind tests: config=$config"
+        print_config "valgrind tests: config=$config" $args
         printf "\nbuilding python ...\n\n"
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --without-pymalloc > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --without-pymalloc $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ======================== valgrind tests ===========================\n\n"
         $valgrind ./python -m test -uall test_decimal
 
         cd Modules/_decimal
+    done
 done
 
 # deccheck
 cd ../../
-for config in $CONFIGS; do
+for args in "--without-decimal-contextvar" ""; do
+    for config in $CONFIGS; do
 
         unset PYTHON_DECIMAL_WITH_MACHINE
         if [ X"$config" != X"auto" ]; then
@@ -126,22 +129,22 @@
         fi
 
         ############ debug ############
-        print_config "deccheck: config=$config --with-pydebug"
+        print_config "deccheck: config=$config --with-pydebug" $args
         printf "\nbuilding python ...\n\n"
 
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ========================== debug ===========================\n\n"
         ./python Modules/_decimal/tests/deccheck.py
 
         ########### regular ###########
-        print_config "deccheck: config=$config "
+        print_config "deccheck: config=$config" $args
         printf "\nbuilding python ...\n\n"
 
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ======================== regular ===========================\n\n"
@@ -157,15 +160,16 @@
                   esac
         esac
 
-        print_config "valgrind deccheck: config=$config "
+        print_config "valgrind deccheck: config=$config" $args
         printf "\nbuilding python ...\n\n"
 
         $GMAKE distclean > /dev/null 2>&1
-        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --without-pymalloc > /dev/null 2>&1
+        ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --without-pymalloc $args > /dev/null 2>&1
         $GMAKE | grep _decimal
 
         printf "\n\n# ======================== valgrind ==========================\n\n"
         $valgrind ./python Modules/_decimal/tests/deccheck.py
+    done
 done
 
 
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index c3f30c9..a96e3f4 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -950,8 +950,8 @@
 _elementtree_Element___getstate___impl(ElementObject *self)
 /*[clinic end generated code: output=37279aeeb6bb5b04 input=f0d16d7ec2f7adc1]*/
 {
-    Py_ssize_t i, noattrib;
-    PyObject *instancedict = NULL, *children;
+    Py_ssize_t i;
+    PyObject *children, *attrib;
 
     /* Build a list of children. */
     children = PyList_New(self->extra ? self->extra->length : 0);
@@ -963,33 +963,24 @@
         PyList_SET_ITEM(children, i, child);
     }
 
-    /* Construct the state object. */
-    noattrib = (self->extra == NULL || self->extra->attrib == Py_None);
-    if (noattrib)
-        instancedict = Py_BuildValue("{sOsOs{}sOsO}",
-                                     PICKLED_TAG, self->tag,
-                                     PICKLED_CHILDREN, children,
-                                     PICKLED_ATTRIB,
-                                     PICKLED_TEXT, JOIN_OBJ(self->text),
-                                     PICKLED_TAIL, JOIN_OBJ(self->tail));
-    else
-        instancedict = Py_BuildValue("{sOsOsOsOsO}",
-                                     PICKLED_TAG, self->tag,
-                                     PICKLED_CHILDREN, children,
-                                     PICKLED_ATTRIB, self->extra->attrib,
-                                     PICKLED_TEXT, JOIN_OBJ(self->text),
-                                     PICKLED_TAIL, JOIN_OBJ(self->tail));
-    if (instancedict) {
-        Py_DECREF(children);
-        return instancedict;
+    if (self->extra && self->extra->attrib != Py_None) {
+        attrib = self->extra->attrib;
+        Py_INCREF(attrib);
     }
     else {
-        for (i = 0; i < PyList_GET_SIZE(children); i++)
-            Py_DECREF(PyList_GET_ITEM(children, i));
-        Py_DECREF(children);
-
-        return NULL;
+        attrib = PyDict_New();
+        if (!attrib) {
+            Py_DECREF(children);
+            return NULL;
+        }
     }
+
+    return Py_BuildValue("{sOsNsNsOsO}",
+                         PICKLED_TAG, self->tag,
+                         PICKLED_CHILDREN, children,
+                         PICKLED_ATTRIB, attrib,
+                         PICKLED_TEXT, JOIN_OBJ(self->text),
+                         PICKLED_TAIL, JOIN_OBJ(self->tail));
 }
 
 static PyObject *
@@ -3886,6 +3877,17 @@
     Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
+Py_LOCAL_INLINE(int)
+_check_xmlparser(XMLParserObject* self)
+{
+    if (self->target == NULL) {
+        PyErr_SetString(PyExc_ValueError,
+                        "XMLParser.__init__() wasn't called");
+        return 0;
+    }
+    return 1;
+}
+
 LOCAL(PyObject*)
 expat_parse(XMLParserObject* self, const char* data, int data_len, int final)
 {
@@ -3922,6 +3924,10 @@
     /* end feeding data to parser */
 
     PyObject* res;
+
+    if (!_check_xmlparser(self)) {
+        return NULL;
+    }
     res = expat_parse(self, "", 0, 1);
     if (!res)
         return NULL;
@@ -3953,6 +3959,9 @@
 {
     /* feed data to parser */
 
+    if (!_check_xmlparser(self)) {
+        return NULL;
+    }
     if (PyUnicode_Check(data)) {
         Py_ssize_t data_len;
         const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len);
@@ -4000,6 +4009,9 @@
     PyObject* temp;
     PyObject* res;
 
+    if (!_check_xmlparser(self)) {
+        return NULL;
+    }
     reader = PyObject_GetAttrString(file, "read");
     if (!reader)
         return NULL;
@@ -4087,6 +4099,9 @@
     TreeBuilderObject *target;
     PyObject *events_append, *events_seq;
 
+    if (!_check_xmlparser(self)) {
+        return NULL;
+    }
     if (!TreeBuilder_CheckExact(self->target)) {
         PyErr_SetString(
             PyExc_TypeError,
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 55e2734..55affb2c 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -7961,6 +7961,7 @@
     Py_VISIT(st->import_mapping_3to2);
     Py_VISIT(st->codecs_encode);
     Py_VISIT(st->getattr);
+    Py_VISIT(st->partial);
     return 0;
 }
 
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 01b9dc4..8cfa6e5 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -193,22 +193,30 @@
 }
 
 static PyObject *
-_pysqlite_build_column_name(const char* colname)
+_pysqlite_build_column_name(pysqlite_Cursor *self, const char *colname)
 {
     const char* pos;
+    Py_ssize_t len;
 
     if (!colname) {
         Py_RETURN_NONE;
     }
 
-    for (pos = colname;; pos++) {
-        if (*pos == 0 || *pos == '[') {
-            if ((*pos == '[') && (pos > colname) && (*(pos-1) == ' ')) {
-                pos--;
+    if (self->connection->detect_types & PARSE_COLNAMES) {
+        for (pos = colname; *pos; pos++) {
+            if (*pos == '[') {
+                if ((pos != colname) && (*(pos-1) == ' ')) {
+                    pos--;
+                }
+                break;
             }
-            return PyUnicode_FromStringAndSize(colname, pos - colname);
         }
+        len = pos - colname;
     }
+    else {
+        len = strlen(colname);
+    }
+    return PyUnicode_FromStringAndSize(colname, len);
 }
 
 /*
@@ -370,6 +378,7 @@
     PyObject* result;
     int numcols;
     PyObject* descriptor;
+    PyObject* column_name;
     PyObject* second_argument = NULL;
     sqlite_int64 lastrowid;
 
@@ -546,7 +555,13 @@
                 if (!descriptor) {
                     goto error;
                 }
-                PyTuple_SetItem(descriptor, 0, _pysqlite_build_column_name(sqlite3_column_name(self->statement->st, i)));
+                column_name = _pysqlite_build_column_name(self,
+                                sqlite3_column_name(self->statement->st, i));
+                if (!column_name) {
+                    Py_DECREF(descriptor);
+                    goto error;
+                }
+                PyTuple_SetItem(descriptor, 0, column_name);
                 Py_INCREF(Py_None); PyTuple_SetItem(descriptor, 1, Py_None);
                 Py_INCREF(Py_None); PyTuple_SetItem(descriptor, 2, Py_None);
                 Py_INCREF(Py_None); PyTuple_SetItem(descriptor, 3, Py_None);
diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h
index 85165b9..8f2994f 100644
--- a/Modules/_ssl_data.h
+++ b/Modules/_ssl_data.h
@@ -1,1948 +1,6323 @@
 /* File generated by Tools/ssl/make_ssl_data.py */
-/* Generated on 2015-01-17T20:33:43.377453 */
+/* Generated on 2020-04-13T21:45:54.559159 */
 
 static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
+    {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
+    {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
+    {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
+    {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_CMS
+    {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
+    {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
+    {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRYPTO
+    {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
+    {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
+    {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
+    {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_EC
+    {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ENGINE
+    {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_EVP
+    {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_KDF
+    {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_OCSP
+    {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_PEM
     {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
+    {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
+    {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_RAND
+    {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
+    {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_SSL
     {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_TS
+    {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
+    {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_X509
     {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
+    {"X509V3", ERR_LIB_X509V3},
+#endif
     { NULL }
 };
 
 static struct py_ssl_error_code error_codes[] = {
+  #ifdef ASN1_R_ADDING_OBJECT
+    {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
+  #else
+    {"ADDING_OBJECT", 13, 171},
+  #endif
+  #ifdef ASN1_R_ASN1_PARSE_ERROR
+    {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR},
+  #else
+    {"ASN1_PARSE_ERROR", 13, 203},
+  #endif
+  #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR
+    {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR},
+  #else
+    {"ASN1_SIG_PARSE_ERROR", 13, 204},
+  #endif
+  #ifdef ASN1_R_AUX_ERROR
+    {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR},
+  #else
+    {"AUX_ERROR", 13, 100},
+  #endif
+  #ifdef ASN1_R_BAD_OBJECT_HEADER
+    {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER},
+  #else
+    {"BAD_OBJECT_HEADER", 13, 102},
+  #endif
+  #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH
+    {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH},
+  #else
+    {"BMPSTRING_IS_WRONG_LENGTH", 13, 214},
+  #endif
+  #ifdef ASN1_R_BN_LIB
+    {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB},
+  #else
+    {"BN_LIB", 13, 105},
+  #endif
+  #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH
+    {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH},
+  #else
+    {"BOOLEAN_IS_WRONG_LENGTH", 13, 106},
+  #endif
+  #ifdef ASN1_R_BUFFER_TOO_SMALL
+    {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL},
+  #else
+    {"BUFFER_TOO_SMALL", 13, 107},
+  #endif
+  #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+    {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+  #else
+    {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108},
+  #endif
+  #ifdef ASN1_R_CONTEXT_NOT_INITIALISED
+    {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED},
+  #else
+    {"CONTEXT_NOT_INITIALISED", 13, 217},
+  #endif
+  #ifdef ASN1_R_DATA_IS_WRONG
+    {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG},
+  #else
+    {"DATA_IS_WRONG", 13, 109},
+  #endif
+  #ifdef ASN1_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 13, 110},
+  #endif
+  #ifdef ASN1_R_DEPTH_EXCEEDED
+    {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED},
+  #else
+    {"DEPTH_EXCEEDED", 13, 174},
+  #endif
+  #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED
+    {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED},
+  #else
+    {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198},
+  #endif
+  #ifdef ASN1_R_ENCODE_ERROR
+    {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR},
+  #else
+    {"ENCODE_ERROR", 13, 112},
+  #endif
+  #ifdef ASN1_R_ERROR_GETTING_TIME
+    {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME},
+  #else
+    {"ERROR_GETTING_TIME", 13, 173},
+  #endif
+  #ifdef ASN1_R_ERROR_LOADING_SECTION
+    {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION},
+  #else
+    {"ERROR_LOADING_SECTION", 13, 172},
+  #endif
+  #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS
+    {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS},
+  #else
+    {"ERROR_SETTING_CIPHER_PARAMS", 13, 114},
+  #endif
+  #ifdef ASN1_R_EXPECTING_AN_INTEGER
+    {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER},
+  #else
+    {"EXPECTING_AN_INTEGER", 13, 115},
+  #endif
+  #ifdef ASN1_R_EXPECTING_AN_OBJECT
+    {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT},
+  #else
+    {"EXPECTING_AN_OBJECT", 13, 116},
+  #endif
+  #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH
+    {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH},
+  #else
+    {"EXPLICIT_LENGTH_MISMATCH", 13, 119},
+  #endif
+  #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
+    {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED},
+  #else
+    {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120},
+  #endif
+  #ifdef ASN1_R_FIELD_MISSING
+    {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING},
+  #else
+    {"FIELD_MISSING", 13, 121},
+  #endif
+  #ifdef ASN1_R_FIRST_NUM_TOO_LARGE
+    {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE},
+  #else
+    {"FIRST_NUM_TOO_LARGE", 13, 122},
+  #endif
+  #ifdef ASN1_R_HEADER_TOO_LONG
+    {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG},
+  #else
+    {"HEADER_TOO_LONG", 13, 123},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT
+    {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT},
+  #else
+    {"ILLEGAL_BITSTRING_FORMAT", 13, 175},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_BOOLEAN
+    {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN},
+  #else
+    {"ILLEGAL_BOOLEAN", 13, 176},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_CHARACTERS
+    {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS},
+  #else
+    {"ILLEGAL_CHARACTERS", 13, 124},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_FORMAT
+    {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT},
+  #else
+    {"ILLEGAL_FORMAT", 13, 177},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_HEX
+    {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX},
+  #else
+    {"ILLEGAL_HEX", 13, 178},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG
+    {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG},
+  #else
+    {"ILLEGAL_IMPLICIT_TAG", 13, 179},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_INTEGER
+    {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER},
+  #else
+    {"ILLEGAL_INTEGER", 13, 180},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE
+    {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE},
+  #else
+    {"ILLEGAL_NEGATIVE_VALUE", 13, 226},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING
+    {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING},
+  #else
+    {"ILLEGAL_NESTED_TAGGING", 13, 181},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_NULL
+    {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL},
+  #else
+    {"ILLEGAL_NULL", 13, 125},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_NULL_VALUE
+    {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE},
+  #else
+    {"ILLEGAL_NULL_VALUE", 13, 182},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_OBJECT
+    {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT},
+  #else
+    {"ILLEGAL_OBJECT", 13, 183},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY
+    {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY},
+  #else
+    {"ILLEGAL_OPTIONAL_ANY", 13, 126},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE
+    {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE},
+  #else
+    {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_PADDING
+    {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING},
+  #else
+    {"ILLEGAL_PADDING", 13, 221},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_TAGGED_ANY
+    {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY},
+  #else
+    {"ILLEGAL_TAGGED_ANY", 13, 127},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_TIME_VALUE
+    {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE},
+  #else
+    {"ILLEGAL_TIME_VALUE", 13, 184},
+  #endif
+  #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT
+    {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT},
+  #else
+    {"ILLEGAL_ZERO_CONTENT", 13, 222},
+  #endif
+  #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT
+    {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT},
+  #else
+    {"INTEGER_NOT_ASCII_FORMAT", 13, 185},
+  #endif
+  #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG
+    {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG},
+  #else
+    {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128},
+  #endif
+  #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT
+    {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT},
+  #else
+    {"INVALID_BIT_STRING_BITS_LEFT", 13, 220},
+  #endif
+  #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH
+    {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH},
+  #else
+    {"INVALID_BMPSTRING_LENGTH", 13, 129},
+  #endif
+  #ifdef ASN1_R_INVALID_DIGIT
+    {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT},
+  #else
+    {"INVALID_DIGIT", 13, 130},
+  #endif
+  #ifdef ASN1_R_INVALID_MIME_TYPE
+    {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE},
+  #else
+    {"INVALID_MIME_TYPE", 13, 205},
+  #endif
+  #ifdef ASN1_R_INVALID_MODIFIER
+    {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER},
+  #else
+    {"INVALID_MODIFIER", 13, 186},
+  #endif
+  #ifdef ASN1_R_INVALID_NUMBER
+    {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER},
+  #else
+    {"INVALID_NUMBER", 13, 187},
+  #endif
+  #ifdef ASN1_R_INVALID_OBJECT_ENCODING
+    {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING},
+  #else
+    {"INVALID_OBJECT_ENCODING", 13, 216},
+  #endif
+  #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS
+    {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS},
+  #else
+    {"INVALID_SCRYPT_PARAMETERS", 13, 227},
+  #endif
+  #ifdef ASN1_R_INVALID_SEPARATOR
+    {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR},
+  #else
+    {"INVALID_SEPARATOR", 13, 131},
+  #endif
+  #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE
+    {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE},
+  #else
+    {"INVALID_STRING_TABLE_VALUE", 13, 218},
+  #endif
+  #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH
+    {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH},
+  #else
+    {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133},
+  #endif
+  #ifdef ASN1_R_INVALID_UTF8STRING
+    {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING},
+  #else
+    {"INVALID_UTF8STRING", 13, 134},
+  #endif
+  #ifdef ASN1_R_INVALID_VALUE
+    {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE},
+  #else
+    {"INVALID_VALUE", 13, 219},
+  #endif
+  #ifdef ASN1_R_LIST_ERROR
+    {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR},
+  #else
+    {"LIST_ERROR", 13, 188},
+  #endif
+  #ifdef ASN1_R_MIME_NO_CONTENT_TYPE
+    {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE},
+  #else
+    {"MIME_NO_CONTENT_TYPE", 13, 206},
+  #endif
+  #ifdef ASN1_R_MIME_PARSE_ERROR
+    {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR},
+  #else
+    {"MIME_PARSE_ERROR", 13, 207},
+  #endif
+  #ifdef ASN1_R_MIME_SIG_PARSE_ERROR
+    {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR},
+  #else
+    {"MIME_SIG_PARSE_ERROR", 13, 208},
+  #endif
+  #ifdef ASN1_R_MISSING_EOC
+    {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC},
+  #else
+    {"MISSING_EOC", 13, 137},
+  #endif
+  #ifdef ASN1_R_MISSING_SECOND_NUMBER
+    {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER},
+  #else
+    {"MISSING_SECOND_NUMBER", 13, 138},
+  #endif
+  #ifdef ASN1_R_MISSING_VALUE
+    {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE},
+  #else
+    {"MISSING_VALUE", 13, 189},
+  #endif
+  #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL
+    {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL},
+  #else
+    {"MSTRING_NOT_UNIVERSAL", 13, 139},
+  #endif
+  #ifdef ASN1_R_MSTRING_WRONG_TAG
+    {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG},
+  #else
+    {"MSTRING_WRONG_TAG", 13, 140},
+  #endif
+  #ifdef ASN1_R_NESTED_ASN1_STRING
+    {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING},
+  #else
+    {"NESTED_ASN1_STRING", 13, 197},
+  #endif
+  #ifdef ASN1_R_NESTED_TOO_DEEP
+    {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP},
+  #else
+    {"NESTED_TOO_DEEP", 13, 201},
+  #endif
+  #ifdef ASN1_R_NON_HEX_CHARACTERS
+    {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS},
+  #else
+    {"NON_HEX_CHARACTERS", 13, 141},
+  #endif
+  #ifdef ASN1_R_NOT_ASCII_FORMAT
+    {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT},
+  #else
+    {"NOT_ASCII_FORMAT", 13, 190},
+  #endif
+  #ifdef ASN1_R_NOT_ENOUGH_DATA
+    {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA},
+  #else
+    {"NOT_ENOUGH_DATA", 13, 142},
+  #endif
+  #ifdef ASN1_R_NO_CONTENT_TYPE
+    {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE},
+  #else
+    {"NO_CONTENT_TYPE", 13, 209},
+  #endif
+  #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE
+    {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE},
+  #else
+    {"NO_MATCHING_CHOICE_TYPE", 13, 143},
+  #endif
+  #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE
+    {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE},
+  #else
+    {"NO_MULTIPART_BODY_FAILURE", 13, 210},
+  #endif
+  #ifdef ASN1_R_NO_MULTIPART_BOUNDARY
+    {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY},
+  #else
+    {"NO_MULTIPART_BOUNDARY", 13, 211},
+  #endif
+  #ifdef ASN1_R_NO_SIG_CONTENT_TYPE
+    {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE},
+  #else
+    {"NO_SIG_CONTENT_TYPE", 13, 212},
+  #endif
+  #ifdef ASN1_R_NULL_IS_WRONG_LENGTH
+    {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH},
+  #else
+    {"NULL_IS_WRONG_LENGTH", 13, 144},
+  #endif
+  #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT
+    {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT},
+  #else
+    {"OBJECT_NOT_ASCII_FORMAT", 13, 191},
+  #endif
+  #ifdef ASN1_R_ODD_NUMBER_OF_CHARS
+    {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS},
+  #else
+    {"ODD_NUMBER_OF_CHARS", 13, 145},
+  #endif
+  #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE
+    {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE},
+  #else
+    {"SECOND_NUMBER_TOO_LARGE", 13, 147},
+  #endif
+  #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH
+    {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH},
+  #else
+    {"SEQUENCE_LENGTH_MISMATCH", 13, 148},
+  #endif
+  #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED
+    {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED},
+  #else
+    {"SEQUENCE_NOT_CONSTRUCTED", 13, 149},
+  #endif
+  #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
+    {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG},
+  #else
+    {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192},
+  #endif
+  #ifdef ASN1_R_SHORT_LINE
+    {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE},
+  #else
+    {"SHORT_LINE", 13, 150},
+  #endif
+  #ifdef ASN1_R_SIG_INVALID_MIME_TYPE
+    {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE},
+  #else
+    {"SIG_INVALID_MIME_TYPE", 13, 213},
+  #endif
+  #ifdef ASN1_R_STREAMING_NOT_SUPPORTED
+    {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED},
+  #else
+    {"STREAMING_NOT_SUPPORTED", 13, 202},
+  #endif
+  #ifdef ASN1_R_STRING_TOO_LONG
+    {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG},
+  #else
+    {"STRING_TOO_LONG", 13, 151},
+  #endif
+  #ifdef ASN1_R_STRING_TOO_SHORT
+    {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT},
+  #else
+    {"STRING_TOO_SHORT", 13, 152},
+  #endif
+  #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+    {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+  #else
+    {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154},
+  #endif
+  #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT
+    {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT},
+  #else
+    {"TIME_NOT_ASCII_FORMAT", 13, 193},
+  #endif
+  #ifdef ASN1_R_TOO_LARGE
+    {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE},
+  #else
+    {"TOO_LARGE", 13, 223},
+  #endif
+  #ifdef ASN1_R_TOO_LONG
+    {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG},
+  #else
+    {"TOO_LONG", 13, 155},
+  #endif
+  #ifdef ASN1_R_TOO_SMALL
+    {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL},
+  #else
+    {"TOO_SMALL", 13, 224},
+  #endif
+  #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED
+    {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED},
+  #else
+    {"TYPE_NOT_CONSTRUCTED", 13, 156},
+  #endif
+  #ifdef ASN1_R_TYPE_NOT_PRIMITIVE
+    {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE},
+  #else
+    {"TYPE_NOT_PRIMITIVE", 13, 195},
+  #endif
+  #ifdef ASN1_R_UNEXPECTED_EOC
+    {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC},
+  #else
+    {"UNEXPECTED_EOC", 13, 159},
+  #endif
+  #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
+    {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH},
+  #else
+    {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_FORMAT
+    {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT},
+  #else
+    {"UNKNOWN_FORMAT", 13, 160},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM
+    {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM},
+  #else
+    {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE
+    {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE},
+  #else
+    {"UNKNOWN_OBJECT_TYPE", 13, 162},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE
+    {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE},
+  #else
+    {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM
+    {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM},
+  #else
+    {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199},
+  #endif
+  #ifdef ASN1_R_UNKNOWN_TAG
+    {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG},
+  #else
+    {"UNKNOWN_TAG", 13, 194},
+  #endif
+  #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE
+    {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE},
+  #else
+    {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164},
+  #endif
+  #ifdef ASN1_R_UNSUPPORTED_CIPHER
+    {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER},
+  #else
+    {"UNSUPPORTED_CIPHER", 13, 228},
+  #endif
+  #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+    {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+  #else
+    {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167},
+  #endif
+  #ifdef ASN1_R_UNSUPPORTED_TYPE
+    {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE},
+  #else
+    {"UNSUPPORTED_TYPE", 13, 196},
+  #endif
+  #ifdef ASN1_R_WRONG_INTEGER_TYPE
+    {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE},
+  #else
+    {"WRONG_INTEGER_TYPE", 13, 225},
+  #endif
+  #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE
+    {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE},
+  #else
+    {"WRONG_PUBLIC_KEY_TYPE", 13, 200},
+  #endif
+  #ifdef ASN1_R_WRONG_TAG
+    {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG},
+  #else
+    {"WRONG_TAG", 13, 168},
+  #endif
+  #ifdef ASYNC_R_FAILED_TO_SET_POOL
+    {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL},
+  #else
+    {"FAILED_TO_SET_POOL", 51, 101},
+  #endif
+  #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT
+    {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT},
+  #else
+    {"FAILED_TO_SWAP_CONTEXT", 51, 102},
+  #endif
+  #ifdef ASYNC_R_INIT_FAILED
+    {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED},
+  #else
+    {"INIT_FAILED", 51, 105},
+  #endif
+  #ifdef ASYNC_R_INVALID_POOL_SIZE
+    {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE},
+  #else
+    {"INVALID_POOL_SIZE", 51, 103},
+  #endif
+  #ifdef BIO_R_ACCEPT_ERROR
+    {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR},
+  #else
+    {"ACCEPT_ERROR", 32, 100},
+  #endif
+  #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET
+    {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET},
+  #else
+    {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141},
+  #endif
+  #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE
+    {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE},
+  #else
+    {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129},
+  #endif
+  #ifdef BIO_R_BAD_FOPEN_MODE
+    {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE},
+  #else
+    {"BAD_FOPEN_MODE", 32, 101},
+  #endif
+  #ifdef BIO_R_BROKEN_PIPE
+    {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE},
+  #else
+    {"BROKEN_PIPE", 32, 124},
+  #endif
+  #ifdef BIO_R_CONNECT_ERROR
+    {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR},
+  #else
+    {"CONNECT_ERROR", 32, 103},
+  #endif
+  #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET
+    {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET},
+  #else
+    {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107},
+  #endif
+  #ifdef BIO_R_GETSOCKNAME_ERROR
+    {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR},
+  #else
+    {"GETSOCKNAME_ERROR", 32, 132},
+  #endif
+  #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS
+    {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS},
+  #else
+    {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133},
+  #endif
+  #ifdef BIO_R_GETTING_SOCKTYPE
+    {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE},
+  #else
+    {"GETTING_SOCKTYPE", 32, 134},
+  #endif
+  #ifdef BIO_R_INVALID_ARGUMENT
+    {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT},
+  #else
+    {"INVALID_ARGUMENT", 32, 125},
+  #endif
+  #ifdef BIO_R_INVALID_SOCKET
+    {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET},
+  #else
+    {"INVALID_SOCKET", 32, 135},
+  #endif
+  #ifdef BIO_R_IN_USE
+    {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE},
+  #else
+    {"IN_USE", 32, 123},
+  #endif
+  #ifdef BIO_R_LENGTH_TOO_LONG
+    {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG},
+  #else
+    {"LENGTH_TOO_LONG", 32, 102},
+  #endif
+  #ifdef BIO_R_LISTEN_V6_ONLY
+    {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY},
+  #else
+    {"LISTEN_V6_ONLY", 32, 136},
+  #endif
+  #ifdef BIO_R_LOOKUP_RETURNED_NOTHING
+    {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING},
+  #else
+    {"LOOKUP_RETURNED_NOTHING", 32, 142},
+  #endif
+  #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE
+    {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE},
+  #else
+    {"MALFORMED_HOST_OR_SERVICE", 32, 130},
+  #endif
+  #ifdef BIO_R_NBIO_CONNECT_ERROR
+    {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR},
+  #else
+    {"NBIO_CONNECT_ERROR", 32, 110},
+  #endif
+  #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED
+    {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED},
+  #else
+    {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143},
+  #endif
+  #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED
+    {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED},
+  #else
+    {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144},
+  #endif
+  #ifdef BIO_R_NO_PORT_DEFINED
+    {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED},
+  #else
+    {"NO_PORT_DEFINED", 32, 113},
+  #endif
+  #ifdef BIO_R_NO_SUCH_FILE
+    {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE},
+  #else
+    {"NO_SUCH_FILE", 32, 128},
+  #endif
+  #ifdef BIO_R_NULL_PARAMETER
+    {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER},
+  #else
+    {"NULL_PARAMETER", 32, 115},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_BIND_SOCKET
+    {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET},
+  #else
+    {"UNABLE_TO_BIND_SOCKET", 32, 117},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET
+    {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET},
+  #else
+    {"UNABLE_TO_CREATE_SOCKET", 32, 118},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_KEEPALIVE
+    {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE},
+  #else
+    {"UNABLE_TO_KEEPALIVE", 32, 137},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET
+    {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET},
+  #else
+    {"UNABLE_TO_LISTEN_SOCKET", 32, 119},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_NODELAY
+    {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY},
+  #else
+    {"UNABLE_TO_NODELAY", 32, 138},
+  #endif
+  #ifdef BIO_R_UNABLE_TO_REUSEADDR
+    {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR},
+  #else
+    {"UNABLE_TO_REUSEADDR", 32, 139},
+  #endif
+  #ifdef BIO_R_UNAVAILABLE_IP_FAMILY
+    {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY},
+  #else
+    {"UNAVAILABLE_IP_FAMILY", 32, 145},
+  #endif
+  #ifdef BIO_R_UNINITIALIZED
+    {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED},
+  #else
+    {"UNINITIALIZED", 32, 120},
+  #endif
+  #ifdef BIO_R_UNKNOWN_INFO_TYPE
+    {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE},
+  #else
+    {"UNKNOWN_INFO_TYPE", 32, 140},
+  #endif
+  #ifdef BIO_R_UNSUPPORTED_IP_FAMILY
+    {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY},
+  #else
+    {"UNSUPPORTED_IP_FAMILY", 32, 146},
+  #endif
+  #ifdef BIO_R_UNSUPPORTED_METHOD
+    {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD},
+  #else
+    {"UNSUPPORTED_METHOD", 32, 121},
+  #endif
+  #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY
+    {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY},
+  #else
+    {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131},
+  #endif
+  #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO
+    {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO},
+  #else
+    {"WRITE_TO_READ_ONLY_BIO", 32, 126},
+  #endif
+  #ifdef BIO_R_WSASTARTUP
+    {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP},
+  #else
+    {"WSASTARTUP", 32, 122},
+  #endif
+  #ifdef BN_R_ARG2_LT_ARG3
+    {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3},
+  #else
+    {"ARG2_LT_ARG3", 3, 100},
+  #endif
+  #ifdef BN_R_BAD_RECIPROCAL
+    {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL},
+  #else
+    {"BAD_RECIPROCAL", 3, 101},
+  #endif
+  #ifdef BN_R_BIGNUM_TOO_LONG
+    {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG},
+  #else
+    {"BIGNUM_TOO_LONG", 3, 114},
+  #endif
+  #ifdef BN_R_BITS_TOO_SMALL
+    {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL},
+  #else
+    {"BITS_TOO_SMALL", 3, 118},
+  #endif
+  #ifdef BN_R_CALLED_WITH_EVEN_MODULUS
+    {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS},
+  #else
+    {"CALLED_WITH_EVEN_MODULUS", 3, 102},
+  #endif
+  #ifdef BN_R_DIV_BY_ZERO
+    {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO},
+  #else
+    {"DIV_BY_ZERO", 3, 103},
+  #endif
+  #ifdef BN_R_ENCODING_ERROR
+    {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR},
+  #else
+    {"ENCODING_ERROR", 3, 104},
+  #endif
+  #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA
+    {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA},
+  #else
+    {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105},
+  #endif
+  #ifdef BN_R_INPUT_NOT_REDUCED
+    {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED},
+  #else
+    {"INPUT_NOT_REDUCED", 3, 110},
+  #endif
+  #ifdef BN_R_INVALID_LENGTH
+    {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH},
+  #else
+    {"INVALID_LENGTH", 3, 106},
+  #endif
+  #ifdef BN_R_INVALID_RANGE
+    {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE},
+  #else
+    {"INVALID_RANGE", 3, 115},
+  #endif
+  #ifdef BN_R_INVALID_SHIFT
+    {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT},
+  #else
+    {"INVALID_SHIFT", 3, 119},
+  #endif
+  #ifdef BN_R_NOT_A_SQUARE
+    {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE},
+  #else
+    {"NOT_A_SQUARE", 3, 111},
+  #endif
+  #ifdef BN_R_NOT_INITIALIZED
+    {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED},
+  #else
+    {"NOT_INITIALIZED", 3, 107},
+  #endif
+  #ifdef BN_R_NO_INVERSE
+    {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE},
+  #else
+    {"NO_INVERSE", 3, 108},
+  #endif
+  #ifdef BN_R_NO_SOLUTION
+    {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION},
+  #else
+    {"NO_SOLUTION", 3, 116},
+  #endif
+  #ifdef BN_R_PRIVATE_KEY_TOO_LARGE
+    {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE},
+  #else
+    {"PRIVATE_KEY_TOO_LARGE", 3, 117},
+  #endif
+  #ifdef BN_R_P_IS_NOT_PRIME
+    {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME},
+  #else
+    {"P_IS_NOT_PRIME", 3, 112},
+  #endif
+  #ifdef BN_R_TOO_MANY_ITERATIONS
+    {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS},
+  #else
+    {"TOO_MANY_ITERATIONS", 3, 113},
+  #endif
+  #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES
+    {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES},
+  #else
+    {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109},
+  #endif
+  #ifdef CMS_R_ADD_SIGNER_ERROR
+    {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR},
+  #else
+    {"ADD_SIGNER_ERROR", 46, 99},
+  #endif
+  #ifdef CMS_R_ATTRIBUTE_ERROR
+    {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR},
+  #else
+    {"ATTRIBUTE_ERROR", 46, 161},
+  #endif
+  #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT
+    {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT},
+  #else
+    {"CERTIFICATE_ALREADY_PRESENT", 46, 175},
+  #endif
+  #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID
+    {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID},
+  #else
+    {"CERTIFICATE_HAS_NO_KEYID", 46, 160},
+  #endif
+  #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR
+    {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR},
+  #else
+    {"CERTIFICATE_VERIFY_ERROR", 46, 100},
+  #endif
+  #ifdef CMS_R_CIPHER_INITIALISATION_ERROR
+    {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR},
+  #else
+    {"CIPHER_INITIALISATION_ERROR", 46, 101},
+  #endif
+  #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
+    {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR},
+  #else
+    {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102},
+  #endif
+  #ifdef CMS_R_CMS_DATAFINAL_ERROR
+    {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR},
+  #else
+    {"CMS_DATAFINAL_ERROR", 46, 103},
+  #endif
+  #ifdef CMS_R_CMS_LIB
+    {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB},
+  #else
+    {"CMS_LIB", 46, 104},
+  #endif
+  #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH
+    {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH},
+  #else
+    {"CONTENTIDENTIFIER_MISMATCH", 46, 170},
+  #endif
+  #ifdef CMS_R_CONTENT_NOT_FOUND
+    {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND},
+  #else
+    {"CONTENT_NOT_FOUND", 46, 105},
+  #endif
+  #ifdef CMS_R_CONTENT_TYPE_MISMATCH
+    {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH},
+  #else
+    {"CONTENT_TYPE_MISMATCH", 46, 171},
+  #endif
+  #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA
+    {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA},
+  #else
+    {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106},
+  #endif
+  #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA
+    {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA},
+  #else
+    {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107},
+  #endif
+  #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA
+    {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA},
+  #else
+    {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108},
+  #endif
+  #ifdef CMS_R_CONTENT_VERIFY_ERROR
+    {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR},
+  #else
+    {"CONTENT_VERIFY_ERROR", 46, 109},
+  #endif
+  #ifdef CMS_R_CTRL_ERROR
+    {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR},
+  #else
+    {"CTRL_ERROR", 46, 110},
+  #endif
+  #ifdef CMS_R_CTRL_FAILURE
+    {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE},
+  #else
+    {"CTRL_FAILURE", 46, 111},
+  #endif
+  #ifdef CMS_R_DECRYPT_ERROR
+    {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR},
+  #else
+    {"DECRYPT_ERROR", 46, 112},
+  #endif
+  #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY
+    {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY},
+  #else
+    {"ERROR_GETTING_PUBLIC_KEY", 46, 113},
+  #endif
+  #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE
+    {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE},
+  #else
+    {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114},
+  #endif
+  #ifdef CMS_R_ERROR_SETTING_KEY
+    {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY},
+  #else
+    {"ERROR_SETTING_KEY", 46, 115},
+  #endif
+  #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO
+    {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO},
+  #else
+    {"ERROR_SETTING_RECIPIENTINFO", 46, 116},
+  #endif
+  #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH
+    {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH},
+  #else
+    {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117},
+  #endif
+  #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER
+    {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER},
+  #else
+    {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176},
+  #endif
+  #ifdef CMS_R_INVALID_KEY_LENGTH
+    {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH},
+  #else
+    {"INVALID_KEY_LENGTH", 46, 118},
+  #endif
+  #ifdef CMS_R_MD_BIO_INIT_ERROR
+    {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR},
+  #else
+    {"MD_BIO_INIT_ERROR", 46, 119},
+  #endif
+  #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH
+    {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH},
+  #else
+    {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120},
+  #endif
+  #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH
+    {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH},
+  #else
+    {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121},
+  #endif
+  #ifdef CMS_R_MSGSIGDIGEST_ERROR
+    {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR},
+  #else
+    {"MSGSIGDIGEST_ERROR", 46, 172},
+  #endif
+  #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE
+    {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE},
+  #else
+    {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162},
+  #endif
+  #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH
+    {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH},
+  #else
+    {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163},
+  #endif
+  #ifdef CMS_R_NEED_ONE_SIGNER
+    {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER},
+  #else
+    {"NEED_ONE_SIGNER", 46, 164},
+  #endif
+  #ifdef CMS_R_NOT_A_SIGNED_RECEIPT
+    {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT},
+  #else
+    {"NOT_A_SIGNED_RECEIPT", 46, 165},
+  #endif
+  #ifdef CMS_R_NOT_ENCRYPTED_DATA
+    {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA},
+  #else
+    {"NOT_ENCRYPTED_DATA", 46, 122},
+  #endif
+  #ifdef CMS_R_NOT_KEK
+    {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK},
+  #else
+    {"NOT_KEK", 46, 123},
+  #endif
+  #ifdef CMS_R_NOT_KEY_AGREEMENT
+    {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT},
+  #else
+    {"NOT_KEY_AGREEMENT", 46, 181},
+  #endif
+  #ifdef CMS_R_NOT_KEY_TRANSPORT
+    {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT},
+  #else
+    {"NOT_KEY_TRANSPORT", 46, 124},
+  #endif
+  #ifdef CMS_R_NOT_PWRI
+    {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI},
+  #else
+    {"NOT_PWRI", 46, 177},
+  #endif
+  #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+    {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+  #else
+    {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125},
+  #endif
+  #ifdef CMS_R_NO_CIPHER
+    {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER},
+  #else
+    {"NO_CIPHER", 46, 126},
+  #endif
+  #ifdef CMS_R_NO_CONTENT
+    {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT},
+  #else
+    {"NO_CONTENT", 46, 127},
+  #endif
+  #ifdef CMS_R_NO_CONTENT_TYPE
+    {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE},
+  #else
+    {"NO_CONTENT_TYPE", 46, 173},
+  #endif
+  #ifdef CMS_R_NO_DEFAULT_DIGEST
+    {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST},
+  #else
+    {"NO_DEFAULT_DIGEST", 46, 128},
+  #endif
+  #ifdef CMS_R_NO_DIGEST_SET
+    {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET},
+  #else
+    {"NO_DIGEST_SET", 46, 129},
+  #endif
+  #ifdef CMS_R_NO_KEY
+    {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY},
+  #else
+    {"NO_KEY", 46, 130},
+  #endif
+  #ifdef CMS_R_NO_KEY_OR_CERT
+    {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT},
+  #else
+    {"NO_KEY_OR_CERT", 46, 174},
+  #endif
+  #ifdef CMS_R_NO_MATCHING_DIGEST
+    {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST},
+  #else
+    {"NO_MATCHING_DIGEST", 46, 131},
+  #endif
+  #ifdef CMS_R_NO_MATCHING_RECIPIENT
+    {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT},
+  #else
+    {"NO_MATCHING_RECIPIENT", 46, 132},
+  #endif
+  #ifdef CMS_R_NO_MATCHING_SIGNATURE
+    {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE},
+  #else
+    {"NO_MATCHING_SIGNATURE", 46, 166},
+  #endif
+  #ifdef CMS_R_NO_MSGSIGDIGEST
+    {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST},
+  #else
+    {"NO_MSGSIGDIGEST", 46, 167},
+  #endif
+  #ifdef CMS_R_NO_PASSWORD
+    {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD},
+  #else
+    {"NO_PASSWORD", 46, 178},
+  #endif
+  #ifdef CMS_R_NO_PRIVATE_KEY
+    {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY},
+  #else
+    {"NO_PRIVATE_KEY", 46, 133},
+  #endif
+  #ifdef CMS_R_NO_PUBLIC_KEY
+    {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY},
+  #else
+    {"NO_PUBLIC_KEY", 46, 134},
+  #endif
+  #ifdef CMS_R_NO_RECEIPT_REQUEST
+    {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST},
+  #else
+    {"NO_RECEIPT_REQUEST", 46, 168},
+  #endif
+  #ifdef CMS_R_NO_SIGNERS
+    {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS},
+  #else
+    {"NO_SIGNERS", 46, 135},
+  #endif
+  #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+  #else
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136},
+  #endif
+  #ifdef CMS_R_RECEIPT_DECODE_ERROR
+    {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR},
+  #else
+    {"RECEIPT_DECODE_ERROR", 46, 169},
+  #endif
+  #ifdef CMS_R_RECIPIENT_ERROR
+    {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR},
+  #else
+    {"RECIPIENT_ERROR", 46, 137},
+  #endif
+  #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND
+    {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND},
+  #else
+    {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138},
+  #endif
+  #ifdef CMS_R_SIGNFINAL_ERROR
+    {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR},
+  #else
+    {"SIGNFINAL_ERROR", 46, 139},
+  #endif
+  #ifdef CMS_R_SMIME_TEXT_ERROR
+    {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR},
+  #else
+    {"SMIME_TEXT_ERROR", 46, 140},
+  #endif
+  #ifdef CMS_R_STORE_INIT_ERROR
+    {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR},
+  #else
+    {"STORE_INIT_ERROR", 46, 141},
+  #endif
+  #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA
+    {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA},
+  #else
+    {"TYPE_NOT_COMPRESSED_DATA", 46, 142},
+  #endif
+  #ifdef CMS_R_TYPE_NOT_DATA
+    {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA},
+  #else
+    {"TYPE_NOT_DATA", 46, 143},
+  #endif
+  #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA
+    {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA},
+  #else
+    {"TYPE_NOT_DIGESTED_DATA", 46, 144},
+  #endif
+  #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA
+    {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA},
+  #else
+    {"TYPE_NOT_ENCRYPTED_DATA", 46, 145},
+  #endif
+  #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA
+    {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA},
+  #else
+    {"TYPE_NOT_ENVELOPED_DATA", 46, 146},
+  #endif
+  #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT
+    {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT},
+  #else
+    {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147},
+  #endif
+  #ifdef CMS_R_UNKNOWN_CIPHER
+    {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER},
+  #else
+    {"UNKNOWN_CIPHER", 46, 148},
+  #endif
+  #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM
+    {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM},
+  #else
+    {"UNKNOWN_DIGEST_ALGORITHM", 46, 149},
+  #endif
+  #ifdef CMS_R_UNKNOWN_ID
+    {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID},
+  #else
+    {"UNKNOWN_ID", 46, 150},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+    {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+  #else
+    {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE
+    {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE},
+  #else
+    {"UNSUPPORTED_CONTENT_TYPE", 46, 152},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM
+    {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM},
+  #else
+    {"UNSUPPORTED_KEK_ALGORITHM", 46, 153},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM
+    {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM},
+  #else
+    {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
+    {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE},
+  #else
+    {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE
+    {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE},
+  #else
+    {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154},
+  #endif
+  #ifdef CMS_R_UNSUPPORTED_TYPE
+    {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE},
+  #else
+    {"UNSUPPORTED_TYPE", 46, 156},
+  #endif
+  #ifdef CMS_R_UNWRAP_ERROR
+    {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR},
+  #else
+    {"UNWRAP_ERROR", 46, 157},
+  #endif
+  #ifdef CMS_R_UNWRAP_FAILURE
+    {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE},
+  #else
+    {"UNWRAP_FAILURE", 46, 180},
+  #endif
+  #ifdef CMS_R_VERIFICATION_FAILURE
+    {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE},
+  #else
+    {"VERIFICATION_FAILURE", 46, 158},
+  #endif
+  #ifdef CMS_R_WRAP_ERROR
+    {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR},
+  #else
+    {"WRAP_ERROR", 46, 159},
+  #endif
+  #ifdef COMP_R_ZLIB_DEFLATE_ERROR
+    {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
+  #else
+    {"ZLIB_DEFLATE_ERROR", 41, 99},
+  #endif
+  #ifdef COMP_R_ZLIB_INFLATE_ERROR
+    {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR},
+  #else
+    {"ZLIB_INFLATE_ERROR", 41, 100},
+  #endif
+  #ifdef COMP_R_ZLIB_NOT_SUPPORTED
+    {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED},
+  #else
+    {"ZLIB_NOT_SUPPORTED", 41, 101},
+  #endif
+  #ifdef CONF_R_ERROR_LOADING_DSO
+    {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
+  #else
+    {"ERROR_LOADING_DSO", 14, 110},
+  #endif
+  #ifdef CONF_R_LIST_CANNOT_BE_NULL
+    {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL},
+  #else
+    {"LIST_CANNOT_BE_NULL", 14, 115},
+  #endif
+  #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET
+    {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET},
+  #else
+    {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100},
+  #endif
+  #ifdef CONF_R_MISSING_EQUAL_SIGN
+    {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN},
+  #else
+    {"MISSING_EQUAL_SIGN", 14, 101},
+  #endif
+  #ifdef CONF_R_MISSING_INIT_FUNCTION
+    {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION},
+  #else
+    {"MISSING_INIT_FUNCTION", 14, 112},
+  #endif
+  #ifdef CONF_R_MODULE_INITIALIZATION_ERROR
+    {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR},
+  #else
+    {"MODULE_INITIALIZATION_ERROR", 14, 109},
+  #endif
+  #ifdef CONF_R_NO_CLOSE_BRACE
+    {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE},
+  #else
+    {"NO_CLOSE_BRACE", 14, 102},
+  #endif
+  #ifdef CONF_R_NO_CONF
+    {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF},
+  #else
+    {"NO_CONF", 14, 105},
+  #endif
+  #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE
+    {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE},
+  #else
+    {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106},
+  #endif
+  #ifdef CONF_R_NO_SECTION
+    {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION},
+  #else
+    {"NO_SECTION", 14, 107},
+  #endif
+  #ifdef CONF_R_NO_SUCH_FILE
+    {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE},
+  #else
+    {"NO_SUCH_FILE", 14, 114},
+  #endif
+  #ifdef CONF_R_NO_VALUE
+    {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE},
+  #else
+    {"NO_VALUE", 14, 108},
+  #endif
+  #ifdef CONF_R_NUMBER_TOO_LARGE
+    {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE},
+  #else
+    {"NUMBER_TOO_LARGE", 14, 121},
+  #endif
+  #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE
+    {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE},
+  #else
+    {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111},
+  #endif
+  #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY
+    {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY},
+  #else
+    {"SSL_COMMAND_SECTION_EMPTY", 14, 117},
+  #endif
+  #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
+    {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND},
+  #else
+    {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118},
+  #endif
+  #ifdef CONF_R_SSL_SECTION_EMPTY
+    {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY},
+  #else
+    {"SSL_SECTION_EMPTY", 14, 119},
+  #endif
+  #ifdef CONF_R_SSL_SECTION_NOT_FOUND
+    {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND},
+  #else
+    {"SSL_SECTION_NOT_FOUND", 14, 120},
+  #endif
+  #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION
+    {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION},
+  #else
+    {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103},
+  #endif
+  #ifdef CONF_R_UNKNOWN_MODULE_NAME
+    {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME},
+  #else
+    {"UNKNOWN_MODULE_NAME", 14, 113},
+  #endif
+  #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG
+    {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG},
+  #else
+    {"VARIABLE_EXPANSION_TOO_LONG", 14, 116},
+  #endif
+  #ifdef CONF_R_VARIABLE_HAS_NO_VALUE
+    {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE},
+  #else
+    {"VARIABLE_HAS_NO_VALUE", 14, 104},
+  #endif
+  #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED
+    {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED},
+  #else
+    {"FIPS_MODE_NOT_SUPPORTED", 15, 101},
+  #endif
+  #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT
+    {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT},
+  #else
+    {"ILLEGAL_HEX_DIGIT", 15, 102},
+  #endif
+  #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS
+    {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS},
+  #else
+    {"ODD_NUMBER_OF_DIGITS", 15, 103},
+  #endif
+  #ifdef CT_R_BASE64_DECODE_ERROR
+    {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR},
+  #else
+    {"BASE64_DECODE_ERROR", 50, 108},
+  #endif
+  #ifdef CT_R_INVALID_LOG_ID_LENGTH
+    {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH},
+  #else
+    {"INVALID_LOG_ID_LENGTH", 50, 100},
+  #endif
+  #ifdef CT_R_LOG_CONF_INVALID
+    {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID},
+  #else
+    {"LOG_CONF_INVALID", 50, 109},
+  #endif
+  #ifdef CT_R_LOG_CONF_INVALID_KEY
+    {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY},
+  #else
+    {"LOG_CONF_INVALID_KEY", 50, 110},
+  #endif
+  #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION
+    {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION},
+  #else
+    {"LOG_CONF_MISSING_DESCRIPTION", 50, 111},
+  #endif
+  #ifdef CT_R_LOG_CONF_MISSING_KEY
+    {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY},
+  #else
+    {"LOG_CONF_MISSING_KEY", 50, 112},
+  #endif
+  #ifdef CT_R_LOG_KEY_INVALID
+    {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID},
+  #else
+    {"LOG_KEY_INVALID", 50, 113},
+  #endif
+  #ifdef CT_R_SCT_FUTURE_TIMESTAMP
+    {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP},
+  #else
+    {"SCT_FUTURE_TIMESTAMP", 50, 116},
+  #endif
+  #ifdef CT_R_SCT_INVALID
+    {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID},
+  #else
+    {"SCT_INVALID", 50, 104},
+  #endif
+  #ifdef CT_R_SCT_INVALID_SIGNATURE
+    {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE},
+  #else
+    {"SCT_INVALID_SIGNATURE", 50, 107},
+  #endif
+  #ifdef CT_R_SCT_LIST_INVALID
+    {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID},
+  #else
+    {"SCT_LIST_INVALID", 50, 105},
+  #endif
+  #ifdef CT_R_SCT_LOG_ID_MISMATCH
+    {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH},
+  #else
+    {"SCT_LOG_ID_MISMATCH", 50, 114},
+  #endif
+  #ifdef CT_R_SCT_NOT_SET
+    {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET},
+  #else
+    {"SCT_NOT_SET", 50, 106},
+  #endif
+  #ifdef CT_R_SCT_UNSUPPORTED_VERSION
+    {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION},
+  #else
+    {"SCT_UNSUPPORTED_VERSION", 50, 115},
+  #endif
+  #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID
+    {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID},
+  #else
+    {"UNRECOGNIZED_SIGNATURE_NID", 50, 101},
+  #endif
+  #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE
+    {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE},
+  #else
+    {"UNSUPPORTED_ENTRY_TYPE", 50, 102},
+  #endif
+  #ifdef CT_R_UNSUPPORTED_VERSION
+    {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION},
+  #else
+    {"UNSUPPORTED_VERSION", 50, 103},
+  #endif
+  #ifdef DH_R_BAD_GENERATOR
+    {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR},
+  #else
+    {"BAD_GENERATOR", 5, 101},
+  #endif
+  #ifdef DH_R_BN_DECODE_ERROR
+    {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR},
+  #else
+    {"BN_DECODE_ERROR", 5, 109},
+  #endif
+  #ifdef DH_R_BN_ERROR
+    {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR},
+  #else
+    {"BN_ERROR", 5, 106},
+  #endif
+  #ifdef DH_R_CHECK_INVALID_J_VALUE
+    {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE},
+  #else
+    {"CHECK_INVALID_J_VALUE", 5, 115},
+  #endif
+  #ifdef DH_R_CHECK_INVALID_Q_VALUE
+    {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE},
+  #else
+    {"CHECK_INVALID_Q_VALUE", 5, 116},
+  #endif
+  #ifdef DH_R_CHECK_PUBKEY_INVALID
+    {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID},
+  #else
+    {"CHECK_PUBKEY_INVALID", 5, 122},
+  #endif
+  #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE
+    {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE},
+  #else
+    {"CHECK_PUBKEY_TOO_LARGE", 5, 123},
+  #endif
+  #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL
+    {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL},
+  #else
+    {"CHECK_PUBKEY_TOO_SMALL", 5, 124},
+  #endif
+  #ifdef DH_R_CHECK_P_NOT_PRIME
+    {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME},
+  #else
+    {"CHECK_P_NOT_PRIME", 5, 117},
+  #endif
+  #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME
+    {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME},
+  #else
+    {"CHECK_P_NOT_SAFE_PRIME", 5, 118},
+  #endif
+  #ifdef DH_R_CHECK_Q_NOT_PRIME
+    {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME},
+  #else
+    {"CHECK_Q_NOT_PRIME", 5, 119},
+  #endif
+  #ifdef DH_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 5, 104},
+  #endif
+  #ifdef DH_R_INVALID_PARAMETER_NAME
+    {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME},
+  #else
+    {"INVALID_PARAMETER_NAME", 5, 110},
+  #endif
+  #ifdef DH_R_INVALID_PARAMETER_NID
+    {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID},
+  #else
+    {"INVALID_PARAMETER_NID", 5, 114},
+  #endif
+  #ifdef DH_R_INVALID_PUBKEY
+    {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY},
+  #else
+    {"INVALID_PUBKEY", 5, 102},
+  #endif
+  #ifdef DH_R_KDF_PARAMETER_ERROR
+    {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR},
+  #else
+    {"KDF_PARAMETER_ERROR", 5, 112},
+  #endif
+  #ifdef DH_R_KEYS_NOT_SET
+    {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET},
+  #else
+    {"KEYS_NOT_SET", 5, 108},
+  #endif
+  #ifdef DH_R_MISSING_PUBKEY
+    {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY},
+  #else
+    {"MISSING_PUBKEY", 5, 125},
+  #endif
+  #ifdef DH_R_MODULUS_TOO_LARGE
+    {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE},
+  #else
+    {"MODULUS_TOO_LARGE", 5, 103},
+  #endif
+  #ifdef DH_R_NOT_SUITABLE_GENERATOR
+    {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR},
+  #else
+    {"NOT_SUITABLE_GENERATOR", 5, 120},
+  #endif
+  #ifdef DH_R_NO_PARAMETERS_SET
+    {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET},
+  #else
+    {"NO_PARAMETERS_SET", 5, 107},
+  #endif
+  #ifdef DH_R_NO_PRIVATE_VALUE
+    {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE},
+  #else
+    {"NO_PRIVATE_VALUE", 5, 100},
+  #endif
+  #ifdef DH_R_PARAMETER_ENCODING_ERROR
+    {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR},
+  #else
+    {"PARAMETER_ENCODING_ERROR", 5, 105},
+  #endif
+  #ifdef DH_R_PEER_KEY_ERROR
+    {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR},
+  #else
+    {"PEER_KEY_ERROR", 5, 111},
+  #endif
+  #ifdef DH_R_SHARED_INFO_ERROR
+    {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR},
+  #else
+    {"SHARED_INFO_ERROR", 5, 113},
+  #endif
+  #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR
+    {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR},
+  #else
+    {"UNABLE_TO_CHECK_GENERATOR", 5, 121},
+  #endif
+  #ifdef DSA_R_BAD_Q_VALUE
+    {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE},
+  #else
+    {"BAD_Q_VALUE", 10, 102},
+  #endif
+  #ifdef DSA_R_BN_DECODE_ERROR
+    {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR},
+  #else
+    {"BN_DECODE_ERROR", 10, 108},
+  #endif
+  #ifdef DSA_R_BN_ERROR
+    {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR},
+  #else
+    {"BN_ERROR", 10, 109},
+  #endif
+  #ifdef DSA_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 10, 104},
+  #endif
+  #ifdef DSA_R_INVALID_DIGEST_TYPE
+    {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE},
+  #else
+    {"INVALID_DIGEST_TYPE", 10, 106},
+  #endif
+  #ifdef DSA_R_INVALID_PARAMETERS
+    {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS},
+  #else
+    {"INVALID_PARAMETERS", 10, 112},
+  #endif
+  #ifdef DSA_R_MISSING_PARAMETERS
+    {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS},
+  #else
+    {"MISSING_PARAMETERS", 10, 101},
+  #endif
+  #ifdef DSA_R_MISSING_PRIVATE_KEY
+    {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY},
+  #else
+    {"MISSING_PRIVATE_KEY", 10, 111},
+  #endif
+  #ifdef DSA_R_MODULUS_TOO_LARGE
+    {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE},
+  #else
+    {"MODULUS_TOO_LARGE", 10, 103},
+  #endif
+  #ifdef DSA_R_NO_PARAMETERS_SET
+    {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET},
+  #else
+    {"NO_PARAMETERS_SET", 10, 107},
+  #endif
+  #ifdef DSA_R_PARAMETER_ENCODING_ERROR
+    {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR},
+  #else
+    {"PARAMETER_ENCODING_ERROR", 10, 105},
+  #endif
+  #ifdef DSA_R_Q_NOT_PRIME
+    {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME},
+  #else
+    {"Q_NOT_PRIME", 10, 113},
+  #endif
+  #ifdef DSA_R_SEED_LEN_SMALL
+    {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL},
+  #else
+    {"SEED_LEN_SMALL", 10, 110},
+  #endif
+  #ifdef EC_R_ASN1_ERROR
+    {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR},
+  #else
+    {"ASN1_ERROR", 16, 115},
+  #endif
+  #ifdef EC_R_BAD_SIGNATURE
+    {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE},
+  #else
+    {"BAD_SIGNATURE", 16, 156},
+  #endif
+  #ifdef EC_R_BIGNUM_OUT_OF_RANGE
+    {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE},
+  #else
+    {"BIGNUM_OUT_OF_RANGE", 16, 144},
+  #endif
+  #ifdef EC_R_BUFFER_TOO_SMALL
+    {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL},
+  #else
+    {"BUFFER_TOO_SMALL", 16, 100},
+  #endif
+  #ifdef EC_R_CANNOT_INVERT
+    {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT},
+  #else
+    {"CANNOT_INVERT", 16, 165},
+  #endif
+  #ifdef EC_R_COORDINATES_OUT_OF_RANGE
+    {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE},
+  #else
+    {"COORDINATES_OUT_OF_RANGE", 16, 146},
+  #endif
+  #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH
+    {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH},
+  #else
+    {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160},
+  #endif
+  #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING
+    {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING},
+  #else
+    {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159},
+  #endif
+  #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE
+    {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE},
+  #else
+    {"D2I_ECPKPARAMETERS_FAILURE", 16, 117},
+  #endif
+  #ifdef EC_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 16, 142},
+  #endif
+  #ifdef EC_R_DISCRIMINANT_IS_ZERO
+    {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO},
+  #else
+    {"DISCRIMINANT_IS_ZERO", 16, 118},
+  #endif
+  #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE
+    {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE},
+  #else
+    {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119},
+  #endif
+  #ifdef EC_R_FIELD_TOO_LARGE
+    {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE},
+  #else
+    {"FIELD_TOO_LARGE", 16, 143},
+  #endif
+  #ifdef EC_R_GF2M_NOT_SUPPORTED
+    {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED},
+  #else
+    {"GF2M_NOT_SUPPORTED", 16, 147},
+  #endif
+  #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE
+    {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE},
+  #else
+    {"GROUP2PKPARAMETERS_FAILURE", 16, 120},
+  #endif
+  #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE
+    {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE},
+  #else
+    {"I2D_ECPKPARAMETERS_FAILURE", 16, 121},
+  #endif
+  #ifdef EC_R_INCOMPATIBLE_OBJECTS
+    {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS},
+  #else
+    {"INCOMPATIBLE_OBJECTS", 16, 101},
+  #endif
+  #ifdef EC_R_INVALID_ARGUMENT
+    {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT},
+  #else
+    {"INVALID_ARGUMENT", 16, 112},
+  #endif
+  #ifdef EC_R_INVALID_COMPRESSED_POINT
+    {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT},
+  #else
+    {"INVALID_COMPRESSED_POINT", 16, 110},
+  #endif
+  #ifdef EC_R_INVALID_COMPRESSION_BIT
+    {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT},
+  #else
+    {"INVALID_COMPRESSION_BIT", 16, 109},
+  #endif
+  #ifdef EC_R_INVALID_CURVE
+    {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE},
+  #else
+    {"INVALID_CURVE", 16, 141},
+  #endif
+  #ifdef EC_R_INVALID_DIGEST
+    {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST},
+  #else
+    {"INVALID_DIGEST", 16, 151},
+  #endif
+  #ifdef EC_R_INVALID_DIGEST_TYPE
+    {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE},
+  #else
+    {"INVALID_DIGEST_TYPE", 16, 138},
+  #endif
+  #ifdef EC_R_INVALID_ENCODING
+    {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING},
+  #else
+    {"INVALID_ENCODING", 16, 102},
+  #endif
+  #ifdef EC_R_INVALID_FIELD
+    {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD},
+  #else
+    {"INVALID_FIELD", 16, 103},
+  #endif
+  #ifdef EC_R_INVALID_FORM
+    {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM},
+  #else
+    {"INVALID_FORM", 16, 104},
+  #endif
+  #ifdef EC_R_INVALID_GROUP_ORDER
+    {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER},
+  #else
+    {"INVALID_GROUP_ORDER", 16, 122},
+  #endif
+  #ifdef EC_R_INVALID_KEY
+    {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY},
+  #else
+    {"INVALID_KEY", 16, 116},
+  #endif
+  #ifdef EC_R_INVALID_OUTPUT_LENGTH
+    {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH},
+  #else
+    {"INVALID_OUTPUT_LENGTH", 16, 161},
+  #endif
+  #ifdef EC_R_INVALID_PEER_KEY
+    {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY},
+  #else
+    {"INVALID_PEER_KEY", 16, 133},
+  #endif
+  #ifdef EC_R_INVALID_PENTANOMIAL_BASIS
+    {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS},
+  #else
+    {"INVALID_PENTANOMIAL_BASIS", 16, 132},
+  #endif
+  #ifdef EC_R_INVALID_PRIVATE_KEY
+    {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY},
+  #else
+    {"INVALID_PRIVATE_KEY", 16, 123},
+  #endif
+  #ifdef EC_R_INVALID_TRINOMIAL_BASIS
+    {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS},
+  #else
+    {"INVALID_TRINOMIAL_BASIS", 16, 137},
+  #endif
+  #ifdef EC_R_KDF_PARAMETER_ERROR
+    {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR},
+  #else
+    {"KDF_PARAMETER_ERROR", 16, 148},
+  #endif
+  #ifdef EC_R_KEYS_NOT_SET
+    {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET},
+  #else
+    {"KEYS_NOT_SET", 16, 140},
+  #endif
+  #ifdef EC_R_LADDER_POST_FAILURE
+    {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE},
+  #else
+    {"LADDER_POST_FAILURE", 16, 136},
+  #endif
+  #ifdef EC_R_LADDER_PRE_FAILURE
+    {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE},
+  #else
+    {"LADDER_PRE_FAILURE", 16, 153},
+  #endif
+  #ifdef EC_R_LADDER_STEP_FAILURE
+    {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE},
+  #else
+    {"LADDER_STEP_FAILURE", 16, 162},
+  #endif
+  #ifdef EC_R_MISSING_PARAMETERS
+    {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS},
+  #else
+    {"MISSING_PARAMETERS", 16, 124},
+  #endif
+  #ifdef EC_R_MISSING_PRIVATE_KEY
+    {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY},
+  #else
+    {"MISSING_PRIVATE_KEY", 16, 125},
+  #endif
+  #ifdef EC_R_NEED_NEW_SETUP_VALUES
+    {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES},
+  #else
+    {"NEED_NEW_SETUP_VALUES", 16, 157},
+  #endif
+  #ifdef EC_R_NOT_A_NIST_PRIME
+    {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME},
+  #else
+    {"NOT_A_NIST_PRIME", 16, 135},
+  #endif
+  #ifdef EC_R_NOT_IMPLEMENTED
+    {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED},
+  #else
+    {"NOT_IMPLEMENTED", 16, 126},
+  #endif
+  #ifdef EC_R_NOT_INITIALIZED
+    {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED},
+  #else
+    {"NOT_INITIALIZED", 16, 111},
+  #endif
+  #ifdef EC_R_NO_PARAMETERS_SET
+    {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET},
+  #else
+    {"NO_PARAMETERS_SET", 16, 139},
+  #endif
+  #ifdef EC_R_NO_PRIVATE_VALUE
+    {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE},
+  #else
+    {"NO_PRIVATE_VALUE", 16, 154},
+  #endif
+  #ifdef EC_R_OPERATION_NOT_SUPPORTED
+    {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED},
+  #else
+    {"OPERATION_NOT_SUPPORTED", 16, 152},
+  #endif
+  #ifdef EC_R_PASSED_NULL_PARAMETER
+    {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER},
+  #else
+    {"PASSED_NULL_PARAMETER", 16, 134},
+  #endif
+  #ifdef EC_R_PEER_KEY_ERROR
+    {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR},
+  #else
+    {"PEER_KEY_ERROR", 16, 149},
+  #endif
+  #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE
+    {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE},
+  #else
+    {"PKPARAMETERS2GROUP_FAILURE", 16, 127},
+  #endif
+  #ifdef EC_R_POINT_ARITHMETIC_FAILURE
+    {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE},
+  #else
+    {"POINT_ARITHMETIC_FAILURE", 16, 155},
+  #endif
+  #ifdef EC_R_POINT_AT_INFINITY
+    {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY},
+  #else
+    {"POINT_AT_INFINITY", 16, 106},
+  #endif
+  #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE
+    {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE},
+  #else
+    {"POINT_COORDINATES_BLIND_FAILURE", 16, 163},
+  #endif
+  #ifdef EC_R_POINT_IS_NOT_ON_CURVE
+    {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE},
+  #else
+    {"POINT_IS_NOT_ON_CURVE", 16, 107},
+  #endif
+  #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED
+    {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED},
+  #else
+    {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158},
+  #endif
+  #ifdef EC_R_SHARED_INFO_ERROR
+    {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR},
+  #else
+    {"SHARED_INFO_ERROR", 16, 150},
+  #endif
+  #ifdef EC_R_SLOT_FULL
+    {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL},
+  #else
+    {"SLOT_FULL", 16, 108},
+  #endif
+  #ifdef EC_R_UNDEFINED_GENERATOR
+    {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR},
+  #else
+    {"UNDEFINED_GENERATOR", 16, 113},
+  #endif
+  #ifdef EC_R_UNDEFINED_ORDER
+    {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER},
+  #else
+    {"UNDEFINED_ORDER", 16, 128},
+  #endif
+  #ifdef EC_R_UNKNOWN_COFACTOR
+    {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR},
+  #else
+    {"UNKNOWN_COFACTOR", 16, 164},
+  #endif
+  #ifdef EC_R_UNKNOWN_GROUP
+    {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP},
+  #else
+    {"UNKNOWN_GROUP", 16, 129},
+  #endif
+  #ifdef EC_R_UNKNOWN_ORDER
+    {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER},
+  #else
+    {"UNKNOWN_ORDER", 16, 114},
+  #endif
+  #ifdef EC_R_UNSUPPORTED_FIELD
+    {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD},
+  #else
+    {"UNSUPPORTED_FIELD", 16, 131},
+  #endif
+  #ifdef EC_R_WRONG_CURVE_PARAMETERS
+    {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS},
+  #else
+    {"WRONG_CURVE_PARAMETERS", 16, 145},
+  #endif
+  #ifdef EC_R_WRONG_ORDER
+    {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER},
+  #else
+    {"WRONG_ORDER", 16, 130},
+  #endif
+  #ifdef ENGINE_R_ALREADY_LOADED
+    {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED},
+  #else
+    {"ALREADY_LOADED", 38, 100},
+  #endif
+  #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER
+    {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER},
+  #else
+    {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133},
+  #endif
+  #ifdef ENGINE_R_CMD_NOT_EXECUTABLE
+    {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE},
+  #else
+    {"CMD_NOT_EXECUTABLE", 38, 134},
+  #endif
+  #ifdef ENGINE_R_COMMAND_TAKES_INPUT
+    {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT},
+  #else
+    {"COMMAND_TAKES_INPUT", 38, 135},
+  #endif
+  #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT
+    {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT},
+  #else
+    {"COMMAND_TAKES_NO_INPUT", 38, 136},
+  #endif
+  #ifdef ENGINE_R_CONFLICTING_ENGINE_ID
+    {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID},
+  #else
+    {"CONFLICTING_ENGINE_ID", 38, 103},
+  #endif
+  #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED
+    {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED},
+  #else
+    {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119},
+  #endif
+  #ifdef ENGINE_R_DSO_FAILURE
+    {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE},
+  #else
+    {"DSO_FAILURE", 38, 104},
+  #endif
+  #ifdef ENGINE_R_DSO_NOT_FOUND
+    {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND},
+  #else
+    {"DSO_NOT_FOUND", 38, 132},
+  #endif
+  #ifdef ENGINE_R_ENGINES_SECTION_ERROR
+    {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR},
+  #else
+    {"ENGINES_SECTION_ERROR", 38, 148},
+  #endif
+  #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR
+    {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR},
+  #else
+    {"ENGINE_CONFIGURATION_ERROR", 38, 102},
+  #endif
+  #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST
+    {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST},
+  #else
+    {"ENGINE_IS_NOT_IN_LIST", 38, 105},
+  #endif
+  #ifdef ENGINE_R_ENGINE_SECTION_ERROR
+    {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR},
+  #else
+    {"ENGINE_SECTION_ERROR", 38, 149},
+  #endif
+  #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY
+    {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY},
+  #else
+    {"FAILED_LOADING_PRIVATE_KEY", 38, 128},
+  #endif
+  #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY
+    {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY},
+  #else
+    {"FAILED_LOADING_PUBLIC_KEY", 38, 129},
+  #endif
+  #ifdef ENGINE_R_FINISH_FAILED
+    {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED},
+  #else
+    {"FINISH_FAILED", 38, 106},
+  #endif
+  #ifdef ENGINE_R_ID_OR_NAME_MISSING
+    {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING},
+  #else
+    {"ID_OR_NAME_MISSING", 38, 108},
+  #endif
+  #ifdef ENGINE_R_INIT_FAILED
+    {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED},
+  #else
+    {"INIT_FAILED", 38, 109},
+  #endif
+  #ifdef ENGINE_R_INTERNAL_LIST_ERROR
+    {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR},
+  #else
+    {"INTERNAL_LIST_ERROR", 38, 110},
+  #endif
+  #ifdef ENGINE_R_INVALID_ARGUMENT
+    {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT},
+  #else
+    {"INVALID_ARGUMENT", 38, 143},
+  #endif
+  #ifdef ENGINE_R_INVALID_CMD_NAME
+    {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME},
+  #else
+    {"INVALID_CMD_NAME", 38, 137},
+  #endif
+  #ifdef ENGINE_R_INVALID_CMD_NUMBER
+    {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER},
+  #else
+    {"INVALID_CMD_NUMBER", 38, 138},
+  #endif
+  #ifdef ENGINE_R_INVALID_INIT_VALUE
+    {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE},
+  #else
+    {"INVALID_INIT_VALUE", 38, 151},
+  #endif
+  #ifdef ENGINE_R_INVALID_STRING
+    {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING},
+  #else
+    {"INVALID_STRING", 38, 150},
+  #endif
+  #ifdef ENGINE_R_NOT_INITIALISED
+    {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED},
+  #else
+    {"NOT_INITIALISED", 38, 117},
+  #endif
+  #ifdef ENGINE_R_NOT_LOADED
+    {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED},
+  #else
+    {"NOT_LOADED", 38, 112},
+  #endif
+  #ifdef ENGINE_R_NO_CONTROL_FUNCTION
+    {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION},
+  #else
+    {"NO_CONTROL_FUNCTION", 38, 120},
+  #endif
+  #ifdef ENGINE_R_NO_INDEX
+    {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX},
+  #else
+    {"NO_INDEX", 38, 144},
+  #endif
+  #ifdef ENGINE_R_NO_LOAD_FUNCTION
+    {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION},
+  #else
+    {"NO_LOAD_FUNCTION", 38, 125},
+  #endif
+  #ifdef ENGINE_R_NO_REFERENCE
+    {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE},
+  #else
+    {"NO_REFERENCE", 38, 130},
+  #endif
+  #ifdef ENGINE_R_NO_SUCH_ENGINE
+    {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE},
+  #else
+    {"NO_SUCH_ENGINE", 38, 116},
+  #endif
+  #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER
+    {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER},
+  #else
+    {"UNIMPLEMENTED_CIPHER", 38, 146},
+  #endif
+  #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST
+    {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST},
+  #else
+    {"UNIMPLEMENTED_DIGEST", 38, 147},
+  #endif
+  #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
+    {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD},
+  #else
+    {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101},
+  #endif
+  #ifdef ENGINE_R_VERSION_INCOMPATIBILITY
+    {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY},
+  #else
+    {"VERSION_INCOMPATIBILITY", 38, 145},
+  #endif
+  #ifdef EVP_R_AES_KEY_SETUP_FAILED
+    {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED},
+  #else
+    {"AES_KEY_SETUP_FAILED", 6, 143},
+  #endif
+  #ifdef EVP_R_ARIA_KEY_SETUP_FAILED
+    {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED},
+  #else
+    {"ARIA_KEY_SETUP_FAILED", 6, 176},
+  #endif
+  #ifdef EVP_R_BAD_DECRYPT
+    {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT},
+  #else
+    {"BAD_DECRYPT", 6, 100},
+  #endif
+  #ifdef EVP_R_BAD_KEY_LENGTH
+    {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH},
+  #else
+    {"BAD_KEY_LENGTH", 6, 195},
+  #endif
+  #ifdef EVP_R_BUFFER_TOO_SMALL
+    {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL},
+  #else
+    {"BUFFER_TOO_SMALL", 6, 155},
+  #endif
+  #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED
+    {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED},
+  #else
+    {"CAMELLIA_KEY_SETUP_FAILED", 6, 157},
+  #endif
+  #ifdef EVP_R_CIPHER_PARAMETER_ERROR
+    {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR},
+  #else
+    {"CIPHER_PARAMETER_ERROR", 6, 122},
+  #endif
+  #ifdef EVP_R_COMMAND_NOT_SUPPORTED
+    {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED},
+  #else
+    {"COMMAND_NOT_SUPPORTED", 6, 147},
+  #endif
+  #ifdef EVP_R_COPY_ERROR
+    {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR},
+  #else
+    {"COPY_ERROR", 6, 173},
+  #endif
+  #ifdef EVP_R_CTRL_NOT_IMPLEMENTED
+    {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED},
+  #else
+    {"CTRL_NOT_IMPLEMENTED", 6, 132},
+  #endif
+  #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
+    {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED},
+  #else
+    {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133},
+  #endif
+  #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
+    {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH},
+  #else
+    {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138},
+  #endif
+  #ifdef EVP_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 6, 114},
+  #endif
+  #ifdef EVP_R_DIFFERENT_KEY_TYPES
+    {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES},
+  #else
+    {"DIFFERENT_KEY_TYPES", 6, 101},
+  #endif
+  #ifdef EVP_R_DIFFERENT_PARAMETERS
+    {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS},
+  #else
+    {"DIFFERENT_PARAMETERS", 6, 153},
+  #endif
+  #ifdef EVP_R_ERROR_LOADING_SECTION
+    {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION},
+  #else
+    {"ERROR_LOADING_SECTION", 6, 165},
+  #endif
+  #ifdef EVP_R_ERROR_SETTING_FIPS_MODE
+    {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE},
+  #else
+    {"ERROR_SETTING_FIPS_MODE", 6, 166},
+  #endif
+  #ifdef EVP_R_EXPECTING_AN_HMAC_KEY
+    {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY},
+  #else
+    {"EXPECTING_AN_HMAC_KEY", 6, 174},
+  #endif
+  #ifdef EVP_R_EXPECTING_AN_RSA_KEY
+    {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY},
+  #else
+    {"EXPECTING_AN_RSA_KEY", 6, 127},
+  #endif
+  #ifdef EVP_R_EXPECTING_A_DH_KEY
+    {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY},
+  #else
+    {"EXPECTING_A_DH_KEY", 6, 128},
+  #endif
+  #ifdef EVP_R_EXPECTING_A_DSA_KEY
+    {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY},
+  #else
+    {"EXPECTING_A_DSA_KEY", 6, 129},
+  #endif
+  #ifdef EVP_R_EXPECTING_A_EC_KEY
+    {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY},
+  #else
+    {"EXPECTING_A_EC_KEY", 6, 142},
+  #endif
+  #ifdef EVP_R_EXPECTING_A_POLY1305_KEY
+    {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY},
+  #else
+    {"EXPECTING_A_POLY1305_KEY", 6, 164},
+  #endif
+  #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY
+    {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY},
+  #else
+    {"EXPECTING_A_SIPHASH_KEY", 6, 175},
+  #endif
+  #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED
+    {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED},
+  #else
+    {"FIPS_MODE_NOT_SUPPORTED", 6, 167},
+  #endif
+  #ifdef EVP_R_GET_RAW_KEY_FAILED
+    {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED},
+  #else
+    {"GET_RAW_KEY_FAILED", 6, 182},
+  #endif
+  #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS
+    {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS},
+  #else
+    {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171},
+  #endif
+  #ifdef EVP_R_INITIALIZATION_ERROR
+    {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR},
+  #else
+    {"INITIALIZATION_ERROR", 6, 134},
+  #endif
+  #ifdef EVP_R_INPUT_NOT_INITIALIZED
+    {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED},
+  #else
+    {"INPUT_NOT_INITIALIZED", 6, 111},
+  #endif
+  #ifdef EVP_R_INVALID_DIGEST
+    {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST},
+  #else
+    {"INVALID_DIGEST", 6, 152},
+  #endif
+  #ifdef EVP_R_INVALID_FIPS_MODE
+    {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE},
+  #else
+    {"INVALID_FIPS_MODE", 6, 168},
+  #endif
+  #ifdef EVP_R_INVALID_IV_LENGTH
+    {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH},
+  #else
+    {"INVALID_IV_LENGTH", 6, 194},
+  #endif
+  #ifdef EVP_R_INVALID_KEY
+    {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY},
+  #else
+    {"INVALID_KEY", 6, 163},
+  #endif
+  #ifdef EVP_R_INVALID_KEY_LENGTH
+    {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH},
+  #else
+    {"INVALID_KEY_LENGTH", 6, 130},
+  #endif
+  #ifdef EVP_R_INVALID_OPERATION
+    {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION},
+  #else
+    {"INVALID_OPERATION", 6, 148},
+  #endif
+  #ifdef EVP_R_KEYGEN_FAILURE
+    {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE},
+  #else
+    {"KEYGEN_FAILURE", 6, 120},
+  #endif
+  #ifdef EVP_R_KEY_SETUP_FAILED
+    {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED},
+  #else
+    {"KEY_SETUP_FAILED", 6, 180},
+  #endif
+  #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED
+    {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED},
+  #else
+    {"MEMORY_LIMIT_EXCEEDED", 6, 172},
+  #endif
+  #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL
+    {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL},
+  #else
+    {"MESSAGE_DIGEST_IS_NULL", 6, 159},
+  #endif
+  #ifdef EVP_R_METHOD_NOT_SUPPORTED
+    {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED},
+  #else
+    {"METHOD_NOT_SUPPORTED", 6, 144},
+  #endif
+  #ifdef EVP_R_MISSING_PARAMETERS
+    {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS},
+  #else
+    {"MISSING_PARAMETERS", 6, 103},
+  #endif
+  #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH
+    {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH},
+  #else
+    {"NOT_XOF_OR_INVALID_LENGTH", 6, 178},
+  #endif
+  #ifdef EVP_R_NO_CIPHER_SET
+    {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET},
+  #else
+    {"NO_CIPHER_SET", 6, 131},
+  #endif
+  #ifdef EVP_R_NO_DEFAULT_DIGEST
+    {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST},
+  #else
+    {"NO_DEFAULT_DIGEST", 6, 158},
+  #endif
+  #ifdef EVP_R_NO_DIGEST_SET
+    {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET},
+  #else
+    {"NO_DIGEST_SET", 6, 139},
+  #endif
+  #ifdef EVP_R_NO_KEY_SET
+    {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET},
+  #else
+    {"NO_KEY_SET", 6, 154},
+  #endif
+  #ifdef EVP_R_NO_OPERATION_SET
+    {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET},
+  #else
+    {"NO_OPERATION_SET", 6, 149},
+  #endif
+  #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED
+    {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED},
+  #else
+    {"ONLY_ONESHOT_SUPPORTED", 6, 177},
+  #endif
+  #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+    {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+  #else
+    {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150},
+  #endif
+  #ifdef EVP_R_OPERATON_NOT_INITIALIZED
+    {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED},
+  #else
+    {"OPERATON_NOT_INITIALIZED", 6, 151},
+  #endif
+  #ifdef EVP_R_PARTIALLY_OVERLAPPING
+    {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING},
+  #else
+    {"PARTIALLY_OVERLAPPING", 6, 162},
+  #endif
+  #ifdef EVP_R_PBKDF2_ERROR
+    {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR},
+  #else
+    {"PBKDF2_ERROR", 6, 181},
+  #endif
+  #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED
+    {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED},
+  #else
+    {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179},
+  #endif
+  #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR
+    {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR},
+  #else
+    {"PRIVATE_KEY_DECODE_ERROR", 6, 145},
+  #endif
+  #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR
+    {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR},
+  #else
+    {"PRIVATE_KEY_ENCODE_ERROR", 6, 146},
+  #endif
+  #ifdef EVP_R_PUBLIC_KEY_NOT_RSA
+    {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA},
+  #else
+    {"PUBLIC_KEY_NOT_RSA", 6, 106},
+  #endif
+  #ifdef EVP_R_UNKNOWN_CIPHER
+    {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER},
+  #else
+    {"UNKNOWN_CIPHER", 6, 160},
+  #endif
+  #ifdef EVP_R_UNKNOWN_DIGEST
+    {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST},
+  #else
+    {"UNKNOWN_DIGEST", 6, 161},
+  #endif
+  #ifdef EVP_R_UNKNOWN_OPTION
+    {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION},
+  #else
+    {"UNKNOWN_OPTION", 6, 169},
+  #endif
+  #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM
+    {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM},
+  #else
+    {"UNKNOWN_PBE_ALGORITHM", 6, 121},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_ALGORITHM
+    {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM},
+  #else
+    {"UNSUPPORTED_ALGORITHM", 6, 156},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_CIPHER
+    {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER},
+  #else
+    {"UNSUPPORTED_CIPHER", 6, 107},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_KEYLENGTH
+    {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH},
+  #else
+    {"UNSUPPORTED_KEYLENGTH", 6, 123},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
+    {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION},
+  #else
+    {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_KEY_SIZE
+    {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE},
+  #else
+    {"UNSUPPORTED_KEY_SIZE", 6, 108},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+    {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+  #else
+    {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_PRF
+    {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF},
+  #else
+    {"UNSUPPORTED_PRF", 6, 125},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+    {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM},
+  #else
+    {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118},
+  #endif
+  #ifdef EVP_R_UNSUPPORTED_SALT_TYPE
+    {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE},
+  #else
+    {"UNSUPPORTED_SALT_TYPE", 6, 126},
+  #endif
+  #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED
+    {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED},
+  #else
+    {"WRAP_MODE_NOT_ALLOWED", 6, 170},
+  #endif
+  #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH
+    {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH},
+  #else
+    {"WRONG_FINAL_BLOCK_LENGTH", 6, 109},
+  #endif
+  #ifdef EVP_R_XTS_DUPLICATED_KEYS
+    {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS},
+  #else
+    {"XTS_DUPLICATED_KEYS", 6, 183},
+  #endif
+  #ifdef KDF_R_INVALID_DIGEST
+    {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST},
+  #else
+    {"INVALID_DIGEST", 52, 100},
+  #endif
+  #ifdef KDF_R_MISSING_ITERATION_COUNT
+    {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT},
+  #else
+    {"MISSING_ITERATION_COUNT", 52, 109},
+  #endif
+  #ifdef KDF_R_MISSING_KEY
+    {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY},
+  #else
+    {"MISSING_KEY", 52, 104},
+  #endif
+  #ifdef KDF_R_MISSING_MESSAGE_DIGEST
+    {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST},
+  #else
+    {"MISSING_MESSAGE_DIGEST", 52, 105},
+  #endif
+  #ifdef KDF_R_MISSING_PARAMETER
+    {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER},
+  #else
+    {"MISSING_PARAMETER", 52, 101},
+  #endif
+  #ifdef KDF_R_MISSING_PASS
+    {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS},
+  #else
+    {"MISSING_PASS", 52, 110},
+  #endif
+  #ifdef KDF_R_MISSING_SALT
+    {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT},
+  #else
+    {"MISSING_SALT", 52, 111},
+  #endif
+  #ifdef KDF_R_MISSING_SECRET
+    {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET},
+  #else
+    {"MISSING_SECRET", 52, 107},
+  #endif
+  #ifdef KDF_R_MISSING_SEED
+    {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED},
+  #else
+    {"MISSING_SEED", 52, 106},
+  #endif
+  #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE
+    {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE},
+  #else
+    {"UNKNOWN_PARAMETER_TYPE", 52, 103},
+  #endif
+  #ifdef KDF_R_VALUE_ERROR
+    {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR},
+  #else
+    {"VALUE_ERROR", 52, 108},
+  #endif
+  #ifdef KDF_R_VALUE_MISSING
+    {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING},
+  #else
+    {"VALUE_MISSING", 52, 102},
+  #endif
+  #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR
+    {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR},
+  #else
+    {"CERTIFICATE_VERIFY_ERROR", 39, 101},
+  #endif
+  #ifdef OCSP_R_DIGEST_ERR
+    {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR},
+  #else
+    {"DIGEST_ERR", 39, 102},
+  #endif
+  #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD
+    {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD},
+  #else
+    {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122},
+  #endif
+  #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD
+    {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD},
+  #else
+    {"ERROR_IN_THISUPDATE_FIELD", 39, 123},
+  #endif
+  #ifdef OCSP_R_ERROR_PARSING_URL
+    {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL},
+  #else
+    {"ERROR_PARSING_URL", 39, 121},
+  #endif
+  #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE
+    {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE},
+  #else
+    {"MISSING_OCSPSIGNING_USAGE", 39, 103},
+  #endif
+  #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE
+    {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE},
+  #else
+    {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124},
+  #endif
+  #ifdef OCSP_R_NOT_BASIC_RESPONSE
+    {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE},
+  #else
+    {"NOT_BASIC_RESPONSE", 39, 104},
+  #endif
+  #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN
+    {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN},
+  #else
+    {"NO_CERTIFICATES_IN_CHAIN", 39, 105},
+  #endif
+  #ifdef OCSP_R_NO_RESPONSE_DATA
+    {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA},
+  #else
+    {"NO_RESPONSE_DATA", 39, 108},
+  #endif
+  #ifdef OCSP_R_NO_REVOKED_TIME
+    {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME},
+  #else
+    {"NO_REVOKED_TIME", 39, 109},
+  #endif
+  #ifdef OCSP_R_NO_SIGNER_KEY
+    {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY},
+  #else
+    {"NO_SIGNER_KEY", 39, 130},
+  #endif
+  #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+  #else
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110},
+  #endif
+  #ifdef OCSP_R_REQUEST_NOT_SIGNED
+    {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED},
+  #else
+    {"REQUEST_NOT_SIGNED", 39, 128},
+  #endif
+  #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA
+    {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA},
+  #else
+    {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111},
+  #endif
+  #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED
+    {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED},
+  #else
+    {"ROOT_CA_NOT_TRUSTED", 39, 112},
+  #endif
+  #ifdef OCSP_R_SERVER_RESPONSE_ERROR
+    {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR},
+  #else
+    {"SERVER_RESPONSE_ERROR", 39, 114},
+  #endif
+  #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR
+    {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR},
+  #else
+    {"SERVER_RESPONSE_PARSE_ERROR", 39, 115},
+  #endif
+  #ifdef OCSP_R_SIGNATURE_FAILURE
+    {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE},
+  #else
+    {"SIGNATURE_FAILURE", 39, 117},
+  #endif
+  #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND
+    {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND},
+  #else
+    {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118},
+  #endif
+  #ifdef OCSP_R_STATUS_EXPIRED
+    {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED},
+  #else
+    {"STATUS_EXPIRED", 39, 125},
+  #endif
+  #ifdef OCSP_R_STATUS_NOT_YET_VALID
+    {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID},
+  #else
+    {"STATUS_NOT_YET_VALID", 39, 126},
+  #endif
+  #ifdef OCSP_R_STATUS_TOO_OLD
+    {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD},
+  #else
+    {"STATUS_TOO_OLD", 39, 127},
+  #endif
+  #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST
+    {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST},
+  #else
+    {"UNKNOWN_MESSAGE_DIGEST", 39, 119},
+  #endif
+  #ifdef OCSP_R_UNKNOWN_NID
+    {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID},
+  #else
+    {"UNKNOWN_NID", 39, 120},
+  #endif
+  #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE
+    {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE},
+  #else
+    {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129},
+  #endif
   #ifdef PEM_R_BAD_BASE64_DECODE
     {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
   #else
-    {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100},
+    {"BAD_BASE64_DECODE", 9, 100},
   #endif
   #ifdef PEM_R_BAD_DECRYPT
     {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
   #else
-    {"BAD_DECRYPT", ERR_LIB_PEM, 101},
+    {"BAD_DECRYPT", 9, 101},
   #endif
   #ifdef PEM_R_BAD_END_LINE
     {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
   #else
-    {"BAD_END_LINE", ERR_LIB_PEM, 102},
+    {"BAD_END_LINE", 9, 102},
   #endif
   #ifdef PEM_R_BAD_IV_CHARS
     {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
   #else
-    {"BAD_IV_CHARS", ERR_LIB_PEM, 103},
+    {"BAD_IV_CHARS", 9, 103},
   #endif
   #ifdef PEM_R_BAD_MAGIC_NUMBER
     {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
   #else
-    {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116},
+    {"BAD_MAGIC_NUMBER", 9, 116},
   #endif
   #ifdef PEM_R_BAD_PASSWORD_READ
     {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
   #else
-    {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104},
+    {"BAD_PASSWORD_READ", 9, 104},
   #endif
   #ifdef PEM_R_BAD_VERSION_NUMBER
     {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
   #else
-    {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117},
+    {"BAD_VERSION_NUMBER", 9, 117},
   #endif
   #ifdef PEM_R_BIO_WRITE_FAILURE
     {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
   #else
-    {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118},
+    {"BIO_WRITE_FAILURE", 9, 118},
   #endif
   #ifdef PEM_R_CIPHER_IS_NULL
     {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
   #else
-    {"CIPHER_IS_NULL", ERR_LIB_PEM, 127},
+    {"CIPHER_IS_NULL", 9, 127},
   #endif
   #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
     {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
   #else
-    {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115},
+    {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115},
   #endif
   #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
     {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
   #else
-    {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119},
+    {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119},
   #endif
   #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
     {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
   #else
-    {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120},
+    {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120},
+  #endif
+  #ifdef PEM_R_HEADER_TOO_LONG
+    {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG},
+  #else
+    {"HEADER_TOO_LONG", 9, 128},
   #endif
   #ifdef PEM_R_INCONSISTENT_HEADER
     {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
   #else
-    {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121},
+    {"INCONSISTENT_HEADER", 9, 121},
   #endif
   #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
     {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
   #else
-    {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122},
+    {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122},
   #endif
   #ifdef PEM_R_KEYBLOB_TOO_SHORT
     {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
   #else
-    {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123},
+    {"KEYBLOB_TOO_SHORT", 9, 123},
+  #endif
+  #ifdef PEM_R_MISSING_DEK_IV
+    {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV},
+  #else
+    {"MISSING_DEK_IV", 9, 129},
   #endif
   #ifdef PEM_R_NOT_DEK_INFO
     {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
   #else
-    {"NOT_DEK_INFO", ERR_LIB_PEM, 105},
+    {"NOT_DEK_INFO", 9, 105},
   #endif
   #ifdef PEM_R_NOT_ENCRYPTED
     {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
   #else
-    {"NOT_ENCRYPTED", ERR_LIB_PEM, 106},
+    {"NOT_ENCRYPTED", 9, 106},
   #endif
   #ifdef PEM_R_NOT_PROC_TYPE
     {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
   #else
-    {"NOT_PROC_TYPE", ERR_LIB_PEM, 107},
+    {"NOT_PROC_TYPE", 9, 107},
   #endif
   #ifdef PEM_R_NO_START_LINE
     {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
   #else
-    {"NO_START_LINE", ERR_LIB_PEM, 108},
+    {"NO_START_LINE", 9, 108},
   #endif
   #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
     {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD},
   #else
-    {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109},
+    {"PROBLEMS_GETTING_PASSWORD", 9, 109},
   #endif
   #ifdef PEM_R_PUBLIC_KEY_NO_RSA
     {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA},
   #else
-    {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110},
+    {"PUBLIC_KEY_NO_RSA", 9, 110},
   #endif
   #ifdef PEM_R_PVK_DATA_TOO_SHORT
     {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
   #else
-    {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124},
+    {"PVK_DATA_TOO_SHORT", 9, 124},
   #endif
   #ifdef PEM_R_PVK_TOO_SHORT
     {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
   #else
-    {"PVK_TOO_SHORT", ERR_LIB_PEM, 125},
+    {"PVK_TOO_SHORT", 9, 125},
   #endif
   #ifdef PEM_R_READ_KEY
     {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
   #else
-    {"READ_KEY", ERR_LIB_PEM, 111},
+    {"READ_KEY", 9, 111},
   #endif
   #ifdef PEM_R_SHORT_HEADER
     {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
   #else
-    {"SHORT_HEADER", ERR_LIB_PEM, 112},
+    {"SHORT_HEADER", 9, 112},
+  #endif
+  #ifdef PEM_R_UNEXPECTED_DEK_IV
+    {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV},
+  #else
+    {"UNEXPECTED_DEK_IV", 9, 130},
   #endif
   #ifdef PEM_R_UNSUPPORTED_CIPHER
     {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
   #else
-    {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113},
+    {"UNSUPPORTED_CIPHER", 9, 113},
   #endif
   #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
     {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
   #else
-    {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114},
+    {"UNSUPPORTED_ENCRYPTION", 9, 114},
   #endif
   #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
     {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS},
   #else
-    {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126},
+    {"UNSUPPORTED_KEY_COMPONENTS", 9, 126},
+  #endif
+  #ifdef PKCS12_R_CANT_PACK_STRUCTURE
+    {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE},
+  #else
+    {"CANT_PACK_STRUCTURE", 35, 100},
+  #endif
+  #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA
+    {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA},
+  #else
+    {"CONTENT_TYPE_NOT_DATA", 35, 121},
+  #endif
+  #ifdef PKCS12_R_DECODE_ERROR
+    {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR},
+  #else
+    {"DECODE_ERROR", 35, 101},
+  #endif
+  #ifdef PKCS12_R_ENCODE_ERROR
+    {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR},
+  #else
+    {"ENCODE_ERROR", 35, 102},
+  #endif
+  #ifdef PKCS12_R_ENCRYPT_ERROR
+    {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR},
+  #else
+    {"ENCRYPT_ERROR", 35, 103},
+  #endif
+  #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE
+    {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE},
+  #else
+    {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120},
+  #endif
+  #ifdef PKCS12_R_INVALID_NULL_ARGUMENT
+    {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT},
+  #else
+    {"INVALID_NULL_ARGUMENT", 35, 104},
+  #endif
+  #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER
+    {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER},
+  #else
+    {"INVALID_NULL_PKCS12_POINTER", 35, 105},
+  #endif
+  #ifdef PKCS12_R_IV_GEN_ERROR
+    {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR},
+  #else
+    {"IV_GEN_ERROR", 35, 106},
+  #endif
+  #ifdef PKCS12_R_KEY_GEN_ERROR
+    {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR},
+  #else
+    {"KEY_GEN_ERROR", 35, 107},
+  #endif
+  #ifdef PKCS12_R_MAC_ABSENT
+    {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT},
+  #else
+    {"MAC_ABSENT", 35, 108},
+  #endif
+  #ifdef PKCS12_R_MAC_GENERATION_ERROR
+    {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR},
+  #else
+    {"MAC_GENERATION_ERROR", 35, 109},
+  #endif
+  #ifdef PKCS12_R_MAC_SETUP_ERROR
+    {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR},
+  #else
+    {"MAC_SETUP_ERROR", 35, 110},
+  #endif
+  #ifdef PKCS12_R_MAC_STRING_SET_ERROR
+    {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR},
+  #else
+    {"MAC_STRING_SET_ERROR", 35, 111},
+  #endif
+  #ifdef PKCS12_R_MAC_VERIFY_FAILURE
+    {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE},
+  #else
+    {"MAC_VERIFY_FAILURE", 35, 113},
+  #endif
+  #ifdef PKCS12_R_PARSE_ERROR
+    {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR},
+  #else
+    {"PARSE_ERROR", 35, 114},
+  #endif
+  #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR
+    {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR},
+  #else
+    {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115},
+  #endif
+  #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR
+    {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR},
+  #else
+    {"PKCS12_CIPHERFINAL_ERROR", 35, 116},
+  #endif
+  #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR
+    {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR},
+  #else
+    {"PKCS12_PBE_CRYPT_ERROR", 35, 117},
+  #endif
+  #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM
+    {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM},
+  #else
+    {"UNKNOWN_DIGEST_ALGORITHM", 35, 118},
+  #endif
+  #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE
+    {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE},
+  #else
+    {"UNSUPPORTED_PKCS12_MODE", 35, 119},
+  #endif
+  #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR
+    {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR},
+  #else
+    {"CERTIFICATE_VERIFY_ERROR", 33, 117},
+  #endif
+  #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+    {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+  #else
+    {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144},
+  #endif
+  #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED
+    {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED},
+  #else
+    {"CIPHER_NOT_INITIALIZED", 33, 116},
+  #endif
+  #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT
+    {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT},
+  #else
+    {"CONTENT_AND_DATA_PRESENT", 33, 118},
+  #endif
+  #ifdef PKCS7_R_CTRL_ERROR
+    {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR},
+  #else
+    {"CTRL_ERROR", 33, 152},
+  #endif
+  #ifdef PKCS7_R_DECRYPT_ERROR
+    {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR},
+  #else
+    {"DECRYPT_ERROR", 33, 119},
+  #endif
+  #ifdef PKCS7_R_DIGEST_FAILURE
+    {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE},
+  #else
+    {"DIGEST_FAILURE", 33, 101},
+  #endif
+  #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE
+    {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE},
+  #else
+    {"ENCRYPTION_CTRL_FAILURE", 33, 149},
+  #endif
+  #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+    {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+  #else
+    {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150},
+  #endif
+  #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT
+    {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT},
+  #else
+    {"ERROR_ADDING_RECIPIENT", 33, 120},
+  #endif
+  #ifdef PKCS7_R_ERROR_SETTING_CIPHER
+    {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER},
+  #else
+    {"ERROR_SETTING_CIPHER", 33, 121},
+  #endif
+  #ifdef PKCS7_R_INVALID_NULL_POINTER
+    {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER},
+  #else
+    {"INVALID_NULL_POINTER", 33, 143},
+  #endif
+  #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE
+    {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE},
+  #else
+    {"INVALID_SIGNED_DATA_TYPE", 33, 155},
+  #endif
+  #ifdef PKCS7_R_NO_CONTENT
+    {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT},
+  #else
+    {"NO_CONTENT", 33, 122},
+  #endif
+  #ifdef PKCS7_R_NO_DEFAULT_DIGEST
+    {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST},
+  #else
+    {"NO_DEFAULT_DIGEST", 33, 151},
+  #endif
+  #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND
+    {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND},
+  #else
+    {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154},
+  #endif
+  #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE
+    {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE},
+  #else
+    {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115},
+  #endif
+  #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA
+    {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA},
+  #else
+    {"NO_SIGNATURES_ON_DATA", 33, 123},
+  #endif
+  #ifdef PKCS7_R_NO_SIGNERS
+    {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS},
+  #else
+    {"NO_SIGNERS", 33, 142},
+  #endif
+  #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE
+    {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE},
+  #else
+    {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104},
+  #endif
+  #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR
+    {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR},
+  #else
+    {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124},
+  #endif
+  #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR
+    {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR},
+  #else
+    {"PKCS7_ADD_SIGNER_ERROR", 33, 153},
+  #endif
+  #ifdef PKCS7_R_PKCS7_DATASIGN
+    {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN},
+  #else
+    {"PKCS7_DATASIGN", 33, 145},
+  #endif
+  #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+  #else
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127},
+  #endif
+  #ifdef PKCS7_R_SIGNATURE_FAILURE
+    {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE},
+  #else
+    {"SIGNATURE_FAILURE", 33, 105},
+  #endif
+  #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND
+    {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND},
+  #else
+    {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128},
+  #endif
+  #ifdef PKCS7_R_SIGNING_CTRL_FAILURE
+    {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE},
+  #else
+    {"SIGNING_CTRL_FAILURE", 33, 147},
+  #endif
+  #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+    {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+  #else
+    {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148},
+  #endif
+  #ifdef PKCS7_R_SMIME_TEXT_ERROR
+    {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR},
+  #else
+    {"SMIME_TEXT_ERROR", 33, 129},
+  #endif
+  #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE
+    {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE},
+  #else
+    {"UNABLE_TO_FIND_CERTIFICATE", 33, 106},
+  #endif
+  #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO
+    {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO},
+  #else
+    {"UNABLE_TO_FIND_MEM_BIO", 33, 107},
+  #endif
+  #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST
+    {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST},
+  #else
+    {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108},
+  #endif
+  #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE
+    {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE},
+  #else
+    {"UNKNOWN_DIGEST_TYPE", 33, 109},
+  #endif
+  #ifdef PKCS7_R_UNKNOWN_OPERATION
+    {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION},
+  #else
+    {"UNKNOWN_OPERATION", 33, 110},
+  #endif
+  #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE
+    {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE},
+  #else
+    {"UNSUPPORTED_CIPHER_TYPE", 33, 111},
+  #endif
+  #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE
+    {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE},
+  #else
+    {"UNSUPPORTED_CONTENT_TYPE", 33, 112},
+  #endif
+  #ifdef PKCS7_R_WRONG_CONTENT_TYPE
+    {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE},
+  #else
+    {"WRONG_CONTENT_TYPE", 33, 113},
+  #endif
+  #ifdef PKCS7_R_WRONG_PKCS7_TYPE
+    {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE},
+  #else
+    {"WRONG_PKCS7_TYPE", 33, 114},
+  #endif
+  #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG
+    {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG},
+  #else
+    {"ADDITIONAL_INPUT_TOO_LONG", 36, 102},
+  #endif
+  #ifdef RAND_R_ALREADY_INSTANTIATED
+    {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED},
+  #else
+    {"ALREADY_INSTANTIATED", 36, 103},
+  #endif
+  #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE
+    {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE},
+  #else
+    {"ARGUMENT_OUT_OF_RANGE", 36, 105},
+  #endif
+  #ifdef RAND_R_CANNOT_OPEN_FILE
+    {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE},
+  #else
+    {"CANNOT_OPEN_FILE", 36, 121},
+  #endif
+  #ifdef RAND_R_DRBG_ALREADY_INITIALIZED
+    {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED},
+  #else
+    {"DRBG_ALREADY_INITIALIZED", 36, 129},
+  #endif
+  #ifdef RAND_R_DRBG_NOT_INITIALISED
+    {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED},
+  #else
+    {"DRBG_NOT_INITIALISED", 36, 104},
+  #endif
+  #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG
+    {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG},
+  #else
+    {"ENTROPY_INPUT_TOO_LONG", 36, 106},
+  #endif
+  #ifdef RAND_R_ENTROPY_OUT_OF_RANGE
+    {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE},
+  #else
+    {"ENTROPY_OUT_OF_RANGE", 36, 124},
+  #endif
+  #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED
+    {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED},
+  #else
+    {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127},
+  #endif
+  #ifdef RAND_R_ERROR_INITIALISING_DRBG
+    {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG},
+  #else
+    {"ERROR_INITIALISING_DRBG", 36, 107},
+  #endif
+  #ifdef RAND_R_ERROR_INSTANTIATING_DRBG
+    {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG},
+  #else
+    {"ERROR_INSTANTIATING_DRBG", 36, 108},
+  #endif
+  #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT
+    {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT},
+  #else
+    {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109},
+  #endif
+  #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY
+    {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY},
+  #else
+    {"ERROR_RETRIEVING_ENTROPY", 36, 110},
+  #endif
+  #ifdef RAND_R_ERROR_RETRIEVING_NONCE
+    {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE},
+  #else
+    {"ERROR_RETRIEVING_NONCE", 36, 111},
+  #endif
+  #ifdef RAND_R_FAILED_TO_CREATE_LOCK
+    {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK},
+  #else
+    {"FAILED_TO_CREATE_LOCK", 36, 126},
+  #endif
+  #ifdef RAND_R_FUNC_NOT_IMPLEMENTED
+    {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED},
+  #else
+    {"FUNC_NOT_IMPLEMENTED", 36, 101},
+  #endif
+  #ifdef RAND_R_FWRITE_ERROR
+    {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR},
+  #else
+    {"FWRITE_ERROR", 36, 123},
+  #endif
+  #ifdef RAND_R_GENERATE_ERROR
+    {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR},
+  #else
+    {"GENERATE_ERROR", 36, 112},
+  #endif
+  #ifdef RAND_R_INTERNAL_ERROR
+    {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR},
+  #else
+    {"INTERNAL_ERROR", 36, 113},
+  #endif
+  #ifdef RAND_R_IN_ERROR_STATE
+    {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE},
+  #else
+    {"IN_ERROR_STATE", 36, 114},
+  #endif
+  #ifdef RAND_R_NOT_A_REGULAR_FILE
+    {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE},
+  #else
+    {"NOT_A_REGULAR_FILE", 36, 122},
+  #endif
+  #ifdef RAND_R_NOT_INSTANTIATED
+    {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED},
+  #else
+    {"NOT_INSTANTIATED", 36, 115},
+  #endif
+  #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED
+    {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED},
+  #else
+    {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128},
+  #endif
+  #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED
+    {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED},
+  #else
+    {"PARENT_LOCKING_NOT_ENABLED", 36, 130},
+  #endif
+  #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK
+    {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK},
+  #else
+    {"PARENT_STRENGTH_TOO_WEAK", 36, 131},
+  #endif
+  #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG
+    {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG},
+  #else
+    {"PERSONALISATION_STRING_TOO_LONG", 36, 116},
+  #endif
+  #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED
+    {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED},
+  #else
+    {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133},
+  #endif
+  #ifdef RAND_R_PRNG_NOT_SEEDED
+    {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED},
+  #else
+    {"PRNG_NOT_SEEDED", 36, 100},
+  #endif
+  #ifdef RAND_R_RANDOM_POOL_OVERFLOW
+    {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW},
+  #else
+    {"RANDOM_POOL_OVERFLOW", 36, 125},
+  #endif
+  #ifdef RAND_R_RANDOM_POOL_UNDERFLOW
+    {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW},
+  #else
+    {"RANDOM_POOL_UNDERFLOW", 36, 134},
+  #endif
+  #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG
+    {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG},
+  #else
+    {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117},
+  #endif
+  #ifdef RAND_R_RESEED_ERROR
+    {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR},
+  #else
+    {"RESEED_ERROR", 36, 118},
+  #endif
+  #ifdef RAND_R_SELFTEST_FAILURE
+    {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE},
+  #else
+    {"SELFTEST_FAILURE", 36, 119},
+  #endif
+  #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED
+    {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED},
+  #else
+    {"TOO_LITTLE_NONCE_REQUESTED", 36, 135},
+  #endif
+  #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED
+    {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED},
+  #else
+    {"TOO_MUCH_NONCE_REQUESTED", 36, 136},
+  #endif
+  #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS
+    {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS},
+  #else
+    {"UNSUPPORTED_DRBG_FLAGS", 36, 132},
+  #endif
+  #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE
+    {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE},
+  #else
+    {"UNSUPPORTED_DRBG_TYPE", 36, 120},
+  #endif
+  #ifdef RSA_R_ALGORITHM_MISMATCH
+    {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH},
+  #else
+    {"ALGORITHM_MISMATCH", 4, 100},
+  #endif
+  #ifdef RSA_R_BAD_E_VALUE
+    {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE},
+  #else
+    {"BAD_E_VALUE", 4, 101},
+  #endif
+  #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT
+    {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT},
+  #else
+    {"BAD_FIXED_HEADER_DECRYPT", 4, 102},
+  #endif
+  #ifdef RSA_R_BAD_PAD_BYTE_COUNT
+    {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT},
+  #else
+    {"BAD_PAD_BYTE_COUNT", 4, 103},
+  #endif
+  #ifdef RSA_R_BAD_SIGNATURE
+    {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE},
+  #else
+    {"BAD_SIGNATURE", 4, 104},
+  #endif
+  #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01
+    {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01},
+  #else
+    {"BLOCK_TYPE_IS_NOT_01", 4, 106},
+  #endif
+  #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02
+    {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02},
+  #else
+    {"BLOCK_TYPE_IS_NOT_02", 4, 107},
+  #endif
+  #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN
+    {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN},
+  #else
+    {"DATA_GREATER_THAN_MOD_LEN", 4, 108},
+  #endif
+  #ifdef RSA_R_DATA_TOO_LARGE
+    {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE},
+  #else
+    {"DATA_TOO_LARGE", 4, 109},
+  #endif
+  #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
+    {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE},
+  #else
+    {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110},
+  #endif
+  #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS
+    {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS},
+  #else
+    {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132},
+  #endif
+  #ifdef RSA_R_DATA_TOO_SMALL
+    {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL},
+  #else
+    {"DATA_TOO_SMALL", 4, 111},
+  #endif
+  #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
+    {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE},
+  #else
+    {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122},
+  #endif
+  #ifdef RSA_R_DIGEST_DOES_NOT_MATCH
+    {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH},
+  #else
+    {"DIGEST_DOES_NOT_MATCH", 4, 158},
+  #endif
+  #ifdef RSA_R_DIGEST_NOT_ALLOWED
+    {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED},
+  #else
+    {"DIGEST_NOT_ALLOWED", 4, 145},
+  #endif
+  #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
+    {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY},
+  #else
+    {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112},
+  #endif
+  #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D
+    {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D},
+  #else
+    {"DMP1_NOT_CONGRUENT_TO_D", 4, 124},
+  #endif
+  #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D
+    {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D},
+  #else
+    {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125},
+  #endif
+  #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1
+    {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1},
+  #else
+    {"D_E_NOT_CONGRUENT_TO_1", 4, 123},
+  #endif
+  #ifdef RSA_R_FIRST_OCTET_INVALID
+    {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID},
+  #else
+    {"FIRST_OCTET_INVALID", 4, 133},
+  #endif
+  #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+    {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+  #else
+    {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144},
+  #endif
+  #ifdef RSA_R_INVALID_DIGEST
+    {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST},
+  #else
+    {"INVALID_DIGEST", 4, 157},
+  #endif
+  #ifdef RSA_R_INVALID_DIGEST_LENGTH
+    {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH},
+  #else
+    {"INVALID_DIGEST_LENGTH", 4, 143},
+  #endif
+  #ifdef RSA_R_INVALID_HEADER
+    {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER},
+  #else
+    {"INVALID_HEADER", 4, 137},
+  #endif
+  #ifdef RSA_R_INVALID_LABEL
+    {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL},
+  #else
+    {"INVALID_LABEL", 4, 160},
+  #endif
+  #ifdef RSA_R_INVALID_MESSAGE_LENGTH
+    {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH},
+  #else
+    {"INVALID_MESSAGE_LENGTH", 4, 131},
+  #endif
+  #ifdef RSA_R_INVALID_MGF1_MD
+    {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD},
+  #else
+    {"INVALID_MGF1_MD", 4, 156},
+  #endif
+  #ifdef RSA_R_INVALID_MULTI_PRIME_KEY
+    {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY},
+  #else
+    {"INVALID_MULTI_PRIME_KEY", 4, 167},
+  #endif
+  #ifdef RSA_R_INVALID_OAEP_PARAMETERS
+    {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS},
+  #else
+    {"INVALID_OAEP_PARAMETERS", 4, 161},
+  #endif
+  #ifdef RSA_R_INVALID_PADDING
+    {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING},
+  #else
+    {"INVALID_PADDING", 4, 138},
+  #endif
+  #ifdef RSA_R_INVALID_PADDING_MODE
+    {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE},
+  #else
+    {"INVALID_PADDING_MODE", 4, 141},
+  #endif
+  #ifdef RSA_R_INVALID_PSS_PARAMETERS
+    {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS},
+  #else
+    {"INVALID_PSS_PARAMETERS", 4, 149},
+  #endif
+  #ifdef RSA_R_INVALID_PSS_SALTLEN
+    {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN},
+  #else
+    {"INVALID_PSS_SALTLEN", 4, 146},
+  #endif
+  #ifdef RSA_R_INVALID_SALT_LENGTH
+    {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH},
+  #else
+    {"INVALID_SALT_LENGTH", 4, 150},
+  #endif
+  #ifdef RSA_R_INVALID_TRAILER
+    {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER},
+  #else
+    {"INVALID_TRAILER", 4, 139},
+  #endif
+  #ifdef RSA_R_INVALID_X931_DIGEST
+    {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST},
+  #else
+    {"INVALID_X931_DIGEST", 4, 142},
+  #endif
+  #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q
+    {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q},
+  #else
+    {"IQMP_NOT_INVERSE_OF_Q", 4, 126},
+  #endif
+  #ifdef RSA_R_KEY_PRIME_NUM_INVALID
+    {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID},
+  #else
+    {"KEY_PRIME_NUM_INVALID", 4, 165},
+  #endif
+  #ifdef RSA_R_KEY_SIZE_TOO_SMALL
+    {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL},
+  #else
+    {"KEY_SIZE_TOO_SMALL", 4, 120},
+  #endif
+  #ifdef RSA_R_LAST_OCTET_INVALID
+    {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID},
+  #else
+    {"LAST_OCTET_INVALID", 4, 134},
+  #endif
+  #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED
+    {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED},
+  #else
+    {"MGF1_DIGEST_NOT_ALLOWED", 4, 152},
+  #endif
+  #ifdef RSA_R_MISSING_PRIVATE_KEY
+    {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY},
+  #else
+    {"MISSING_PRIVATE_KEY", 4, 179},
+  #endif
+  #ifdef RSA_R_MODULUS_TOO_LARGE
+    {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE},
+  #else
+    {"MODULUS_TOO_LARGE", 4, 105},
+  #endif
+  #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R
+    {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R},
+  #else
+    {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168},
+  #endif
+  #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D
+    {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D},
+  #else
+    {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169},
+  #endif
+  #ifdef RSA_R_MP_R_NOT_PRIME
+    {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME},
+  #else
+    {"MP_R_NOT_PRIME", 4, 170},
+  #endif
+  #ifdef RSA_R_NO_PUBLIC_EXPONENT
+    {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT},
+  #else
+    {"NO_PUBLIC_EXPONENT", 4, 140},
+  #endif
+  #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING
+    {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING},
+  #else
+    {"NULL_BEFORE_BLOCK_MISSING", 4, 113},
+  #endif
+  #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES
+    {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES},
+  #else
+    {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172},
+  #endif
+  #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q
+    {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q},
+  #else
+    {"N_DOES_NOT_EQUAL_P_Q", 4, 127},
+  #endif
+  #ifdef RSA_R_OAEP_DECODING_ERROR
+    {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR},
+  #else
+    {"OAEP_DECODING_ERROR", 4, 121},
+  #endif
+  #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+    {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+  #else
+    {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148},
+  #endif
+  #ifdef RSA_R_PADDING_CHECK_FAILED
+    {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED},
+  #else
+    {"PADDING_CHECK_FAILED", 4, 114},
+  #endif
+  #ifdef RSA_R_PKCS_DECODING_ERROR
+    {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR},
+  #else
+    {"PKCS_DECODING_ERROR", 4, 159},
+  #endif
+  #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL
+    {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL},
+  #else
+    {"PSS_SALTLEN_TOO_SMALL", 4, 164},
+  #endif
+  #ifdef RSA_R_P_NOT_PRIME
+    {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME},
+  #else
+    {"P_NOT_PRIME", 4, 128},
+  #endif
+  #ifdef RSA_R_Q_NOT_PRIME
+    {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME},
+  #else
+    {"Q_NOT_PRIME", 4, 129},
+  #endif
+  #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
+    {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED},
+  #else
+    {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130},
+  #endif
+  #ifdef RSA_R_SLEN_CHECK_FAILED
+    {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED},
+  #else
+    {"SLEN_CHECK_FAILED", 4, 136},
+  #endif
+  #ifdef RSA_R_SLEN_RECOVERY_FAILED
+    {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED},
+  #else
+    {"SLEN_RECOVERY_FAILED", 4, 135},
+  #endif
+  #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK
+    {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK},
+  #else
+    {"SSLV3_ROLLBACK_ATTACK", 4, 115},
+  #endif
+  #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+    {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+  #else
+    {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116},
+  #endif
+  #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE
+    {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE},
+  #else
+    {"UNKNOWN_ALGORITHM_TYPE", 4, 117},
+  #endif
+  #ifdef RSA_R_UNKNOWN_DIGEST
+    {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST},
+  #else
+    {"UNKNOWN_DIGEST", 4, 166},
+  #endif
+  #ifdef RSA_R_UNKNOWN_MASK_DIGEST
+    {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST},
+  #else
+    {"UNKNOWN_MASK_DIGEST", 4, 151},
+  #endif
+  #ifdef RSA_R_UNKNOWN_PADDING_TYPE
+    {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE},
+  #else
+    {"UNKNOWN_PADDING_TYPE", 4, 118},
+  #endif
+  #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE
+    {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE},
+  #else
+    {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162},
+  #endif
+  #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE
+    {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE},
+  #else
+    {"UNSUPPORTED_LABEL_SOURCE", 4, 163},
+  #endif
+  #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM
+    {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM},
+  #else
+    {"UNSUPPORTED_MASK_ALGORITHM", 4, 153},
+  #endif
+  #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER
+    {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER},
+  #else
+    {"UNSUPPORTED_MASK_PARAMETER", 4, 154},
+  #endif
+  #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE
+    {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE},
+  #else
+    {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155},
+  #endif
+  #ifdef RSA_R_VALUE_MISSING
+    {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING},
+  #else
+    {"VALUE_MISSING", 4, 147},
+  #endif
+  #ifdef RSA_R_WRONG_SIGNATURE_LENGTH
+    {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH},
+  #else
+    {"WRONG_SIGNATURE_LENGTH", 4, 119},
+  #endif
+  #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY
+    {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY},
+  #else
+    {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291},
   #endif
   #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
     {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
   #else
-    {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100},
+    {"APP_DATA_IN_HANDSHAKE", 20, 100},
   #endif
   #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
     {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
   #else
-    {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272},
+    {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272},
   #endif
-  #ifdef SSL_R_BAD_ALERT_RECORD
-    {"BAD_ALERT_RECORD", ERR_LIB_SSL, SSL_R_BAD_ALERT_RECORD},
+  #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE
+    {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE},
   #else
-    {"BAD_ALERT_RECORD", ERR_LIB_SSL, 101},
+    {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143},
   #endif
-  #ifdef SSL_R_BAD_AUTHENTICATION_TYPE
-    {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, SSL_R_BAD_AUTHENTICATION_TYPE},
+  #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE
+    {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE},
   #else
-    {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, 102},
+    {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158},
   #endif
   #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
     {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
   #else
-    {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103},
+    {"BAD_CHANGE_CIPHER_SPEC", 20, 103},
   #endif
-  #ifdef SSL_R_BAD_CHECKSUM
-    {"BAD_CHECKSUM", ERR_LIB_SSL, SSL_R_BAD_CHECKSUM},
+  #ifdef SSL_R_BAD_CIPHER
+    {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER},
   #else
-    {"BAD_CHECKSUM", ERR_LIB_SSL, 104},
+    {"BAD_CIPHER", 20, 186},
   #endif
   #ifdef SSL_R_BAD_DATA
     {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
   #else
-    {"BAD_DATA", ERR_LIB_SSL, 390},
+    {"BAD_DATA", 20, 390},
   #endif
   #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
     {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
   #else
-    {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106},
+    {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106},
   #endif
   #ifdef SSL_R_BAD_DECOMPRESSION
     {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
   #else
-    {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107},
+    {"BAD_DECOMPRESSION", 20, 107},
   #endif
-  #ifdef SSL_R_BAD_DH_G_LENGTH
-    {"BAD_DH_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_G_LENGTH},
+  #ifdef SSL_R_BAD_DH_VALUE
+    {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE},
   #else
-    {"BAD_DH_G_LENGTH", ERR_LIB_SSL, 108},
-  #endif
-  #ifdef SSL_R_BAD_DH_PUB_KEY_LENGTH
-    {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_PUB_KEY_LENGTH},
-  #else
-    {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, 109},
-  #endif
-  #ifdef SSL_R_BAD_DH_P_LENGTH
-    {"BAD_DH_P_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_P_LENGTH},
-  #else
-    {"BAD_DH_P_LENGTH", ERR_LIB_SSL, 110},
+    {"BAD_DH_VALUE", 20, 102},
   #endif
   #ifdef SSL_R_BAD_DIGEST_LENGTH
     {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
   #else
-    {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111},
+    {"BAD_DIGEST_LENGTH", 20, 111},
   #endif
-  #ifdef SSL_R_BAD_DSA_SIGNATURE
-    {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_DSA_SIGNATURE},
+  #ifdef SSL_R_BAD_EARLY_DATA
+    {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA},
   #else
-    {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, 112},
+    {"BAD_EARLY_DATA", 20, 233},
   #endif
   #ifdef SSL_R_BAD_ECC_CERT
     {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
   #else
-    {"BAD_ECC_CERT", ERR_LIB_SSL, 304},
+    {"BAD_ECC_CERT", 20, 304},
   #endif
   #ifdef SSL_R_BAD_ECDSA_SIGNATURE
     {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE},
   #else
-    {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305},
+    {"BAD_ECDSA_SIGNATURE", 20, 305},
   #endif
   #ifdef SSL_R_BAD_ECPOINT
     {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
   #else
-    {"BAD_ECPOINT", ERR_LIB_SSL, 306},
+    {"BAD_ECPOINT", 20, 306},
+  #endif
+  #ifdef SSL_R_BAD_EXTENSION
+    {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION},
+  #else
+    {"BAD_EXTENSION", 20, 110},
   #endif
   #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
     {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
   #else
-    {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332},
+    {"BAD_HANDSHAKE_LENGTH", 20, 332},
+  #endif
+  #ifdef SSL_R_BAD_HANDSHAKE_STATE
+    {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE},
+  #else
+    {"BAD_HANDSHAKE_STATE", 20, 236},
   #endif
   #ifdef SSL_R_BAD_HELLO_REQUEST
     {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
   #else
-    {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105},
+    {"BAD_HELLO_REQUEST", 20, 105},
+  #endif
+  #ifdef SSL_R_BAD_HRR_VERSION
+    {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION},
+  #else
+    {"BAD_HRR_VERSION", 20, 263},
+  #endif
+  #ifdef SSL_R_BAD_KEY_SHARE
+    {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE},
+  #else
+    {"BAD_KEY_SHARE", 20, 108},
+  #endif
+  #ifdef SSL_R_BAD_KEY_UPDATE
+    {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE},
+  #else
+    {"BAD_KEY_UPDATE", 20, 122},
+  #endif
+  #ifdef SSL_R_BAD_LEGACY_VERSION
+    {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION},
+  #else
+    {"BAD_LEGACY_VERSION", 20, 292},
   #endif
   #ifdef SSL_R_BAD_LENGTH
     {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
   #else
-    {"BAD_LENGTH", ERR_LIB_SSL, 271},
-  #endif
-  #ifdef SSL_R_BAD_MAC_DECODE
-    {"BAD_MAC_DECODE", ERR_LIB_SSL, SSL_R_BAD_MAC_DECODE},
-  #else
-    {"BAD_MAC_DECODE", ERR_LIB_SSL, 113},
+    {"BAD_LENGTH", 20, 271},
   #endif
   #ifdef SSL_R_BAD_MAC_LENGTH
     {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH},
   #else
-    {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333},
+    {"BAD_MAC_LENGTH", 20, 333},
   #endif
-  #ifdef SSL_R_BAD_MESSAGE_TYPE
-    {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_BAD_MESSAGE_TYPE},
+  #ifdef SSL_R_BAD_PACKET
+    {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET},
   #else
-    {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, 114},
+    {"BAD_PACKET", 20, 240},
   #endif
   #ifdef SSL_R_BAD_PACKET_LENGTH
     {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
   #else
-    {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115},
+    {"BAD_PACKET_LENGTH", 20, 115},
   #endif
   #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
     {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
   #else
-    {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116},
+    {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116},
+  #endif
+  #ifdef SSL_R_BAD_PSK
+    {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK},
+  #else
+    {"BAD_PSK", 20, 219},
+  #endif
+  #ifdef SSL_R_BAD_PSK_IDENTITY
+    {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY},
+  #else
+    {"BAD_PSK_IDENTITY", 20, 114},
   #endif
   #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH
     {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH},
   #else
-    {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316},
+    {"BAD_PSK_IDENTITY_HINT_LENGTH", 20, 316},
   #endif
-  #ifdef SSL_R_BAD_RESPONSE_ARGUMENT
-    {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, SSL_R_BAD_RESPONSE_ARGUMENT},
+  #ifdef SSL_R_BAD_RECORD_TYPE
+    {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE},
   #else
-    {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, 117},
-  #endif
-  #ifdef SSL_R_BAD_RSA_DECRYPT
-    {"BAD_RSA_DECRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_DECRYPT},
-  #else
-    {"BAD_RSA_DECRYPT", ERR_LIB_SSL, 118},
+    {"BAD_RECORD_TYPE", 20, 443},
   #endif
   #ifdef SSL_R_BAD_RSA_ENCRYPT
     {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
   #else
-    {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119},
-  #endif
-  #ifdef SSL_R_BAD_RSA_E_LENGTH
-    {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_E_LENGTH},
-  #else
-    {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, 120},
-  #endif
-  #ifdef SSL_R_BAD_RSA_MODULUS_LENGTH
-    {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_MODULUS_LENGTH},
-  #else
-    {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, 121},
-  #endif
-  #ifdef SSL_R_BAD_RSA_SIGNATURE
-    {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_RSA_SIGNATURE},
-  #else
-    {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, 122},
+    {"BAD_RSA_ENCRYPT", 20, 119},
   #endif
   #ifdef SSL_R_BAD_SIGNATURE
     {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
   #else
-    {"BAD_SIGNATURE", ERR_LIB_SSL, 123},
+    {"BAD_SIGNATURE", 20, 123},
   #endif
   #ifdef SSL_R_BAD_SRP_A_LENGTH
     {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
   #else
-    {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347},
+    {"BAD_SRP_A_LENGTH", 20, 347},
   #endif
   #ifdef SSL_R_BAD_SRP_B_LENGTH
     {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH},
   #else
-    {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348},
+    {"BAD_SRP_B_LENGTH", 20, 348},
   #endif
   #ifdef SSL_R_BAD_SRP_G_LENGTH
     {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH},
   #else
-    {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349},
+    {"BAD_SRP_G_LENGTH", 20, 349},
   #endif
   #ifdef SSL_R_BAD_SRP_N_LENGTH
     {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH},
   #else
-    {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350},
+    {"BAD_SRP_N_LENGTH", 20, 350},
   #endif
   #ifdef SSL_R_BAD_SRP_PARAMETERS
     {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
   #else
-    {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371},
+    {"BAD_SRP_PARAMETERS", 20, 371},
   #endif
   #ifdef SSL_R_BAD_SRP_S_LENGTH
     {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH},
   #else
-    {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351},
+    {"BAD_SRP_S_LENGTH", 20, 351},
   #endif
   #ifdef SSL_R_BAD_SRTP_MKI_VALUE
     {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
   #else
-    {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352},
+    {"BAD_SRTP_MKI_VALUE", 20, 352},
   #endif
   #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
     {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
   #else
-    {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353},
+    {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353},
   #endif
   #ifdef SSL_R_BAD_SSL_FILETYPE
     {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
   #else
-    {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124},
-  #endif
-  #ifdef SSL_R_BAD_SSL_SESSION_ID_LENGTH
-    {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SSL_SESSION_ID_LENGTH},
-  #else
-    {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, 125},
-  #endif
-  #ifdef SSL_R_BAD_STATE
-    {"BAD_STATE", ERR_LIB_SSL, SSL_R_BAD_STATE},
-  #else
-    {"BAD_STATE", ERR_LIB_SSL, 126},
+    {"BAD_SSL_FILETYPE", 20, 124},
   #endif
   #ifdef SSL_R_BAD_VALUE
     {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
   #else
-    {"BAD_VALUE", ERR_LIB_SSL, 384},
+    {"BAD_VALUE", 20, 384},
   #endif
   #ifdef SSL_R_BAD_WRITE_RETRY
     {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
   #else
-    {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127},
+    {"BAD_WRITE_RETRY", 20, 127},
+  #endif
+  #ifdef SSL_R_BINDER_DOES_NOT_VERIFY
+    {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY},
+  #else
+    {"BINDER_DOES_NOT_VERIFY", 20, 253},
   #endif
   #ifdef SSL_R_BIO_NOT_SET
     {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
   #else
-    {"BIO_NOT_SET", ERR_LIB_SSL, 128},
+    {"BIO_NOT_SET", 20, 128},
   #endif
   #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
     {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
   #else
-    {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129},
+    {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129},
   #endif
   #ifdef SSL_R_BN_LIB
     {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
   #else
-    {"BN_LIB", ERR_LIB_SSL, 130},
+    {"BN_LIB", 20, 130},
+  #endif
+  #ifdef SSL_R_CALLBACK_FAILED
+    {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED},
+  #else
+    {"CALLBACK_FAILED", 20, 234},
+  #endif
+  #ifdef SSL_R_CANNOT_CHANGE_CIPHER
+    {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER},
+  #else
+    {"CANNOT_CHANGE_CIPHER", 20, 109},
   #endif
   #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
     {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
   #else
-    {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131},
-  #endif
-  #ifdef SSL_R_CA_DN_TOO_LONG
-    {"CA_DN_TOO_LONG", ERR_LIB_SSL, SSL_R_CA_DN_TOO_LONG},
-  #else
-    {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132},
+    {"CA_DN_LENGTH_MISMATCH", 20, 131},
   #endif
   #ifdef SSL_R_CA_KEY_TOO_SMALL
     {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
   #else
-    {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397},
+    {"CA_KEY_TOO_SMALL", 20, 397},
   #endif
   #ifdef SSL_R_CA_MD_TOO_WEAK
     {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
   #else
-    {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398},
+    {"CA_MD_TOO_WEAK", 20, 398},
   #endif
   #ifdef SSL_R_CCS_RECEIVED_EARLY
     {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
   #else
-    {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133},
+    {"CCS_RECEIVED_EARLY", 20, 133},
   #endif
   #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
     {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED},
   #else
-    {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134},
+    {"CERTIFICATE_VERIFY_FAILED", 20, 134},
   #endif
   #ifdef SSL_R_CERT_CB_ERROR
     {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
   #else
-    {"CERT_CB_ERROR", ERR_LIB_SSL, 377},
+    {"CERT_CB_ERROR", 20, 377},
   #endif
   #ifdef SSL_R_CERT_LENGTH_MISMATCH
     {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
   #else
-    {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135},
+    {"CERT_LENGTH_MISMATCH", 20, 135},
   #endif
-  #ifdef SSL_R_CHALLENGE_IS_DIFFERENT
-    {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CHALLENGE_IS_DIFFERENT},
+  #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED
+    {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED},
   #else
-    {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, 136},
+    {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218},
   #endif
   #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
     {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH},
   #else
-    {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137},
+    {"CIPHER_CODE_WRONG_LENGTH", 20, 137},
   #endif
   #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE
     {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE},
   #else
-    {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138},
-  #endif
-  #ifdef SSL_R_CIPHER_TABLE_SRC_ERROR
-    {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, SSL_R_CIPHER_TABLE_SRC_ERROR},
-  #else
-    {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, 139},
+    {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138},
   #endif
   #ifdef SSL_R_CLIENTHELLO_TLSEXT
     {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
   #else
-    {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226},
+    {"CLIENTHELLO_TLSEXT", 20, 226},
   #endif
   #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
     {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG},
   #else
-    {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140},
+    {"COMPRESSED_LENGTH_TOO_LONG", 20, 140},
   #endif
   #ifdef SSL_R_COMPRESSION_DISABLED
     {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
   #else
-    {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343},
+    {"COMPRESSION_DISABLED", 20, 343},
   #endif
   #ifdef SSL_R_COMPRESSION_FAILURE
     {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
   #else
-    {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141},
+    {"COMPRESSION_FAILURE", 20, 141},
   #endif
   #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
     {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
   #else
-    {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307},
+    {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307},
   #endif
   #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
     {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR},
   #else
-    {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142},
-  #endif
-  #ifdef SSL_R_CONNECTION_ID_IS_DIFFERENT
-    {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CONNECTION_ID_IS_DIFFERENT},
-  #else
-    {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, 143},
+    {"COMPRESSION_LIBRARY_ERROR", 20, 142},
   #endif
   #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
     {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
   #else
-    {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144},
+    {"CONNECTION_TYPE_NOT_SET", 20, 144},
+  #endif
+  #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED
+    {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED},
+  #else
+    {"CONTEXT_NOT_DANE_ENABLED", 20, 167},
+  #endif
+  #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE
+    {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE},
+  #else
+    {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400},
   #endif
   #ifdef SSL_R_COOKIE_MISMATCH
     {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
   #else
-    {"COOKIE_MISMATCH", ERR_LIB_SSL, 308},
+    {"COOKIE_MISMATCH", 20, 308},
+  #endif
+  #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED
+    {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED},
+  #else
+    {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206},
+  #endif
+  #ifdef SSL_R_DANE_ALREADY_ENABLED
+    {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED},
+  #else
+    {"DANE_ALREADY_ENABLED", 20, 172},
+  #endif
+  #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL
+    {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL},
+  #else
+    {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173},
+  #endif
+  #ifdef SSL_R_DANE_NOT_ENABLED
+    {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED},
+  #else
+    {"DANE_NOT_ENABLED", 20, 175},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE
+    {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE},
+  #else
+    {"DANE_TLSA_BAD_CERTIFICATE", 20, 180},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE
+    {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE},
+  #else
+    {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH
+    {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH},
+  #else
+    {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH
+    {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH},
+  #else
+    {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE
+    {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE},
+  #else
+    {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY
+    {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY},
+  #else
+    {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR
+    {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR},
+  #else
+    {"DANE_TLSA_BAD_SELECTOR", 20, 202},
+  #endif
+  #ifdef SSL_R_DANE_TLSA_NULL_DATA
+    {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA},
+  #else
+    {"DANE_TLSA_NULL_DATA", 20, 203},
   #endif
   #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
     {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
   #else
-    {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145},
+    {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145},
   #endif
   #ifdef SSL_R_DATA_LENGTH_TOO_LONG
     {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
   #else
-    {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146},
+    {"DATA_LENGTH_TOO_LONG", 20, 146},
   #endif
   #ifdef SSL_R_DECRYPTION_FAILED
     {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
   #else
-    {"DECRYPTION_FAILED", ERR_LIB_SSL, 147},
+    {"DECRYPTION_FAILED", 20, 147},
   #endif
   #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
     {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
   #else
-    {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281},
+    {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281},
   #endif
   #ifdef SSL_R_DH_KEY_TOO_SMALL
     {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
   #else
-    {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394},
+    {"DH_KEY_TOO_SMALL", 20, 394},
   #endif
   #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
     {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
   #else
-    {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148},
+    {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148},
   #endif
   #ifdef SSL_R_DIGEST_CHECK_FAILED
     {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
   #else
-    {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149},
+    {"DIGEST_CHECK_FAILED", 20, 149},
   #endif
   #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
     {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
   #else
-    {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334},
+    {"DTLS_MESSAGE_TOO_BIG", 20, 334},
   #endif
   #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
     {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID},
   #else
-    {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309},
+    {"DUPLICATE_COMPRESSION_ID", 20, 309},
   #endif
   #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT
     {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT},
   #else
-    {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317},
+    {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", 20, 317},
   #endif
   #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
     {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING},
   #else
-    {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318},
+    {"ECC_CERT_NOT_FOR_SIGNING", 20, 318},
   #endif
   #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE
     {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE},
   #else
-    {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322},
+    {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", 20, 322},
   #endif
   #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE
     {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE},
   #else
-    {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323},
+    {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", 20, 323},
   #endif
   #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
     {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
   #else
-    {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374},
+    {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374},
   #endif
   #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER
     {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER},
   #else
-    {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310},
+    {"ECGROUP_TOO_LARGE_FOR_CIPHER", 20, 310},
   #endif
   #ifdef SSL_R_EE_KEY_TOO_SMALL
     {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
   #else
-    {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399},
+    {"EE_KEY_TOO_SMALL", 20, 399},
   #endif
   #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
     {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
   #else
-    {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354},
+    {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354},
   #endif
   #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
     {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
   #else
-    {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150},
-  #endif
-  #ifdef SSL_R_ERROR_GENERATING_TMP_RSA_KEY
-    {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_ERROR_GENERATING_TMP_RSA_KEY},
-  #else
-    {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, 282},
+    {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150},
   #endif
   #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
     {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
   #else
-    {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151},
+    {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151},
+  #endif
+  #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN
+    {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN},
+  #else
+    {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204},
+  #endif
+  #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE
+    {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE},
+  #else
+    {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194},
   #endif
   #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
     {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
   #else
-    {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152},
+    {"EXCESSIVE_MESSAGE_SIZE", 20, 152},
+  #endif
+  #ifdef SSL_R_EXTENSION_NOT_RECEIVED
+    {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED},
+  #else
+    {"EXTENSION_NOT_RECEIVED", 20, 279},
   #endif
   #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
     {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
   #else
-    {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153},
+    {"EXTRA_DATA_IN_MESSAGE", 20, 153},
+  #endif
+  #ifdef SSL_R_EXT_LENGTH_MISMATCH
+    {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH},
+  #else
+    {"EXT_LENGTH_MISMATCH", 20, 163},
+  #endif
+  #ifdef SSL_R_FAILED_TO_INIT_ASYNC
+    {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC},
+  #else
+    {"FAILED_TO_INIT_ASYNC", 20, 405},
+  #endif
+  #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO
+    {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO},
+  #else
+    {"FRAGMENTED_CLIENT_HELLO", 20, 401},
   #endif
   #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
     {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
   #else
-    {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154},
+    {"GOT_A_FIN_BEFORE_A_CCS", 20, 154},
   #endif
   #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS
     {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS},
   #else
-    {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355},
+    {"GOT_NEXT_PROTO_BEFORE_A_CCS", 20, 355},
   #endif
   #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION
     {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION},
   #else
-    {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356},
+    {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", 20, 356},
   #endif
   #ifdef SSL_R_HTTPS_PROXY_REQUEST
     {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
   #else
-    {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155},
+    {"HTTPS_PROXY_REQUEST", 20, 155},
   #endif
   #ifdef SSL_R_HTTP_REQUEST
     {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
   #else
-    {"HTTP_REQUEST", ERR_LIB_SSL, 156},
+    {"HTTP_REQUEST", 20, 156},
   #endif
-  #ifdef SSL_R_ILLEGAL_PADDING
-    {"ILLEGAL_PADDING", ERR_LIB_SSL, SSL_R_ILLEGAL_PADDING},
+  #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION
+    {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION},
   #else
-    {"ILLEGAL_PADDING", ERR_LIB_SSL, 283},
+    {"ILLEGAL_POINT_COMPRESSION", 20, 162},
   #endif
   #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
     {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
   #else
-    {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380},
+    {"ILLEGAL_SUITEB_DIGEST", 20, 380},
   #endif
   #ifdef SSL_R_INAPPROPRIATE_FALLBACK
     {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
   #else
-    {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373},
+    {"INAPPROPRIATE_FALLBACK", 20, 373},
   #endif
   #ifdef SSL_R_INCONSISTENT_COMPRESSION
     {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
   #else
-    {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340},
+    {"INCONSISTENT_COMPRESSION", 20, 340},
   #endif
-  #ifdef SSL_R_INVALID_CHALLENGE_LENGTH
-    {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_CHALLENGE_LENGTH},
+  #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN
+    {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN},
   #else
-    {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, 158},
+    {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222},
+  #endif
+  #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI
+    {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI},
+  #else
+    {"INCONSISTENT_EARLY_DATA_SNI", 20, 231},
+  #endif
+  #ifdef SSL_R_INCONSISTENT_EXTMS
+    {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS},
+  #else
+    {"INCONSISTENT_EXTMS", 20, 104},
+  #endif
+  #ifdef SSL_R_INSUFFICIENT_SECURITY
+    {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY},
+  #else
+    {"INSUFFICIENT_SECURITY", 20, 241},
+  #endif
+  #ifdef SSL_R_INVALID_ALERT
+    {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT},
+  #else
+    {"INVALID_ALERT", 20, 205},
+  #endif
+  #ifdef SSL_R_INVALID_CCS_MESSAGE
+    {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE},
+  #else
+    {"INVALID_CCS_MESSAGE", 20, 260},
+  #endif
+  #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG
+    {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG},
+  #else
+    {"INVALID_CERTIFICATE_OR_ALG", 20, 238},
   #endif
   #ifdef SSL_R_INVALID_COMMAND
     {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
   #else
-    {"INVALID_COMMAND", ERR_LIB_SSL, 280},
+    {"INVALID_COMMAND", 20, 280},
   #endif
   #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
     {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM},
   #else
-    {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341},
+    {"INVALID_COMPRESSION_ALGORITHM", 20, 341},
+  #endif
+  #ifdef SSL_R_INVALID_CONFIG
+    {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG},
+  #else
+    {"INVALID_CONFIG", 20, 283},
+  #endif
+  #ifdef SSL_R_INVALID_CONFIGURATION_NAME
+    {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME},
+  #else
+    {"INVALID_CONFIGURATION_NAME", 20, 113},
+  #endif
+  #ifdef SSL_R_INVALID_CONTEXT
+    {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT},
+  #else
+    {"INVALID_CONTEXT", 20, 282},
+  #endif
+  #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE
+    {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE},
+  #else
+    {"INVALID_CT_VALIDATION_TYPE", 20, 212},
+  #endif
+  #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE
+    {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE},
+  #else
+    {"INVALID_KEY_UPDATE_TYPE", 20, 120},
+  #endif
+  #ifdef SSL_R_INVALID_MAX_EARLY_DATA
+    {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA},
+  #else
+    {"INVALID_MAX_EARLY_DATA", 20, 174},
   #endif
   #ifdef SSL_R_INVALID_NULL_CMD_NAME
     {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
   #else
-    {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385},
+    {"INVALID_NULL_CMD_NAME", 20, 385},
   #endif
-  #ifdef SSL_R_INVALID_PURPOSE
-    {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE},
+  #ifdef SSL_R_INVALID_SEQUENCE_NUMBER
+    {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER},
   #else
-    {"INVALID_PURPOSE", ERR_LIB_SSL, 278},
+    {"INVALID_SEQUENCE_NUMBER", 20, 402},
   #endif
   #ifdef SSL_R_INVALID_SERVERINFO_DATA
     {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
   #else
-    {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388},
+    {"INVALID_SERVERINFO_DATA", 20, 388},
+  #endif
+  #ifdef SSL_R_INVALID_SESSION_ID
+    {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID},
+  #else
+    {"INVALID_SESSION_ID", 20, 999},
   #endif
   #ifdef SSL_R_INVALID_SRP_USERNAME
     {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
   #else
-    {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357},
+    {"INVALID_SRP_USERNAME", 20, 357},
   #endif
   #ifdef SSL_R_INVALID_STATUS_RESPONSE
     {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
   #else
-    {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328},
+    {"INVALID_STATUS_RESPONSE", 20, 328},
   #endif
   #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
     {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH},
   #else
-    {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325},
-  #endif
-  #ifdef SSL_R_INVALID_TRUST
-    {"INVALID_TRUST", ERR_LIB_SSL, SSL_R_INVALID_TRUST},
-  #else
-    {"INVALID_TRUST", ERR_LIB_SSL, 279},
-  #endif
-  #ifdef SSL_R_KEY_ARG_TOO_LONG
-    {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, SSL_R_KEY_ARG_TOO_LONG},
-  #else
-    {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, 284},
-  #endif
-  #ifdef SSL_R_KRB5
-    {"KRB5", ERR_LIB_SSL, SSL_R_KRB5},
-  #else
-    {"KRB5", ERR_LIB_SSL, 285},
-  #endif
-  #ifdef SSL_R_KRB5_C_CC_PRINC
-    {"KRB5_C_CC_PRINC", ERR_LIB_SSL, SSL_R_KRB5_C_CC_PRINC},
-  #else
-    {"KRB5_C_CC_PRINC", ERR_LIB_SSL, 286},
-  #endif
-  #ifdef SSL_R_KRB5_C_GET_CRED
-    {"KRB5_C_GET_CRED", ERR_LIB_SSL, SSL_R_KRB5_C_GET_CRED},
-  #else
-    {"KRB5_C_GET_CRED", ERR_LIB_SSL, 287},
-  #endif
-  #ifdef SSL_R_KRB5_C_INIT
-    {"KRB5_C_INIT", ERR_LIB_SSL, SSL_R_KRB5_C_INIT},
-  #else
-    {"KRB5_C_INIT", ERR_LIB_SSL, 288},
-  #endif
-  #ifdef SSL_R_KRB5_C_MK_REQ
-    {"KRB5_C_MK_REQ", ERR_LIB_SSL, SSL_R_KRB5_C_MK_REQ},
-  #else
-    {"KRB5_C_MK_REQ", ERR_LIB_SSL, 289},
-  #endif
-  #ifdef SSL_R_KRB5_S_BAD_TICKET
-    {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, SSL_R_KRB5_S_BAD_TICKET},
-  #else
-    {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, 290},
-  #endif
-  #ifdef SSL_R_KRB5_S_INIT
-    {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT},
-  #else
-    {"KRB5_S_INIT", ERR_LIB_SSL, 291},
-  #endif
-  #ifdef SSL_R_KRB5_S_RD_REQ
-    {"KRB5_S_RD_REQ", ERR_LIB_SSL, SSL_R_KRB5_S_RD_REQ},
-  #else
-    {"KRB5_S_RD_REQ", ERR_LIB_SSL, 292},
-  #endif
-  #ifdef SSL_R_KRB5_S_TKT_EXPIRED
-    {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_EXPIRED},
-  #else
-    {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, 293},
+    {"INVALID_TICKET_KEYS_LENGTH", 20, 325},
   #endif
   #ifdef SSL_R_KRB5_S_TKT_NYV
     {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV},
   #else
-    {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294},
+    {"KRB5_S_TKT_NYV", 20, 294},
   #endif
   #ifdef SSL_R_KRB5_S_TKT_SKEW
     {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW},
   #else
-    {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295},
+    {"KRB5_S_TKT_SKEW", 20, 295},
   #endif
   #ifdef SSL_R_LENGTH_MISMATCH
     {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
   #else
-    {"LENGTH_MISMATCH", ERR_LIB_SSL, 159},
+    {"LENGTH_MISMATCH", 20, 159},
+  #endif
+  #ifdef SSL_R_LENGTH_TOO_LONG
+    {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG},
+  #else
+    {"LENGTH_TOO_LONG", 20, 404},
   #endif
   #ifdef SSL_R_LENGTH_TOO_SHORT
     {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
   #else
-    {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160},
+    {"LENGTH_TOO_SHORT", 20, 160},
   #endif
   #ifdef SSL_R_LIBRARY_BUG
     {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
   #else
-    {"LIBRARY_BUG", ERR_LIB_SSL, 274},
+    {"LIBRARY_BUG", 20, 274},
   #endif
   #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
     {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
   #else
-    {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161},
+    {"LIBRARY_HAS_NO_CIPHERS", 20, 161},
   #endif
   #ifdef SSL_R_MESSAGE_TOO_LONG
     {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG},
   #else
-    {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296},
-  #endif
-  #ifdef SSL_R_MISSING_DH_DSA_CERT
-    {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_DSA_CERT},
-  #else
-    {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, 162},
-  #endif
-  #ifdef SSL_R_MISSING_DH_KEY
-    {"MISSING_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_DH_KEY},
-  #else
-    {"MISSING_DH_KEY", ERR_LIB_SSL, 163},
-  #endif
-  #ifdef SSL_R_MISSING_DH_RSA_CERT
-    {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_RSA_CERT},
-  #else
-    {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, 164},
+    {"MESSAGE_TOO_LONG", 20, 296},
   #endif
   #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
     {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT},
   #else
-    {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165},
+    {"MISSING_DSA_SIGNING_CERT", 20, 165},
   #endif
   #ifdef SSL_R_MISSING_ECDH_CERT
     {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT},
   #else
-    {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382},
+    {"MISSING_ECDH_CERT", 20, 382},
   #endif
   #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
     {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
   #else
-    {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381},
+    {"MISSING_ECDSA_SIGNING_CERT", 20, 381},
   #endif
-  #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY
-    {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_DH_KEY},
+  #ifdef SSL_R_MISSING_FATAL
+    {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL},
   #else
-    {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, 166},
+    {"MISSING_FATAL", 20, 256},
   #endif
-  #ifdef SSL_R_MISSING_EXPORT_TMP_RSA_KEY
-    {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_RSA_KEY},
+  #ifdef SSL_R_MISSING_PARAMETERS
+    {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS},
   #else
-    {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, 167},
+    {"MISSING_PARAMETERS", 20, 290},
   #endif
   #ifdef SSL_R_MISSING_RSA_CERTIFICATE
     {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
   #else
-    {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168},
+    {"MISSING_RSA_CERTIFICATE", 20, 168},
   #endif
   #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
     {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT},
   #else
-    {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169},
+    {"MISSING_RSA_ENCRYPTING_CERT", 20, 169},
   #endif
   #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
     {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT},
   #else
-    {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170},
+    {"MISSING_RSA_SIGNING_CERT", 20, 170},
+  #endif
+  #ifdef SSL_R_MISSING_SIGALGS_EXTENSION
+    {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION},
+  #else
+    {"MISSING_SIGALGS_EXTENSION", 20, 112},
+  #endif
+  #ifdef SSL_R_MISSING_SIGNING_CERT
+    {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT},
+  #else
+    {"MISSING_SIGNING_CERT", 20, 221},
   #endif
   #ifdef SSL_R_MISSING_SRP_PARAM
     {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
   #else
-    {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358},
+    {"MISSING_SRP_PARAM", 20, 358},
+  #endif
+  #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION
+    {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION},
+  #else
+    {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209},
   #endif
   #ifdef SSL_R_MISSING_TMP_DH_KEY
     {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
   #else
-    {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171},
+    {"MISSING_TMP_DH_KEY", 20, 171},
   #endif
   #ifdef SSL_R_MISSING_TMP_ECDH_KEY
     {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
   #else
-    {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311},
+    {"MISSING_TMP_ECDH_KEY", 20, 311},
   #endif
-  #ifdef SSL_R_MISSING_TMP_RSA_KEY
-    {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_KEY},
+  #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA
+    {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA},
   #else
-    {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, 172},
-  #endif
-  #ifdef SSL_R_MISSING_TMP_RSA_PKEY
-    {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_PKEY},
-  #else
-    {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, 173},
-  #endif
-  #ifdef SSL_R_MISSING_VERIFY_MESSAGE
-    {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, SSL_R_MISSING_VERIFY_MESSAGE},
-  #else
-    {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174},
+    {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293},
   #endif
   #ifdef SSL_R_MULTIPLE_SGC_RESTARTS
     {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS},
   #else
-    {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346},
+    {"MULTIPLE_SGC_RESTARTS", 20, 346},
   #endif
-  #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET
-    {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, SSL_R_NON_SSLV2_INITIAL_PACKET},
+  #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY
+    {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY},
   #else
-    {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, 175},
+    {"NOT_ON_RECORD_BOUNDARY", 20, 182},
+  #endif
+  #ifdef SSL_R_NOT_REPLACING_CERTIFICATE
+    {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE},
+  #else
+    {"NOT_REPLACING_CERTIFICATE", 20, 289},
+  #endif
+  #ifdef SSL_R_NOT_SERVER
+    {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER},
+  #else
+    {"NOT_SERVER", 20, 284},
+  #endif
+  #ifdef SSL_R_NO_APPLICATION_PROTOCOL
+    {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL},
+  #else
+    {"NO_APPLICATION_PROTOCOL", 20, 235},
   #endif
   #ifdef SSL_R_NO_CERTIFICATES_RETURNED
     {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED},
   #else
-    {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176},
+    {"NO_CERTIFICATES_RETURNED", 20, 176},
   #endif
   #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
     {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
   #else
-    {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177},
-  #endif
-  #ifdef SSL_R_NO_CERTIFICATE_RETURNED
-    {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_RETURNED},
-  #else
-    {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, 178},
+    {"NO_CERTIFICATE_ASSIGNED", 20, 177},
   #endif
   #ifdef SSL_R_NO_CERTIFICATE_SET
     {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
   #else
-    {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179},
+    {"NO_CERTIFICATE_SET", 20, 179},
   #endif
-  #ifdef SSL_R_NO_CERTIFICATE_SPECIFIED
-    {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SPECIFIED},
+  #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR
+    {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR},
   #else
-    {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, 180},
+    {"NO_CHANGE_FOLLOWING_HRR", 20, 214},
   #endif
   #ifdef SSL_R_NO_CIPHERS_AVAILABLE
     {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
   #else
-    {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181},
-  #endif
-  #ifdef SSL_R_NO_CIPHERS_PASSED
-    {"NO_CIPHERS_PASSED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_PASSED},
-  #else
-    {"NO_CIPHERS_PASSED", ERR_LIB_SSL, 182},
+    {"NO_CIPHERS_AVAILABLE", 20, 181},
   #endif
   #ifdef SSL_R_NO_CIPHERS_SPECIFIED
     {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
   #else
-    {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183},
-  #endif
-  #ifdef SSL_R_NO_CIPHER_LIST
-    {"NO_CIPHER_LIST", ERR_LIB_SSL, SSL_R_NO_CIPHER_LIST},
-  #else
-    {"NO_CIPHER_LIST", ERR_LIB_SSL, 184},
+    {"NO_CIPHERS_SPECIFIED", 20, 183},
   #endif
   #ifdef SSL_R_NO_CIPHER_MATCH
     {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
   #else
-    {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185},
+    {"NO_CIPHER_MATCH", 20, 185},
   #endif
   #ifdef SSL_R_NO_CLIENT_CERT_METHOD
     {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
   #else
-    {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331},
-  #endif
-  #ifdef SSL_R_NO_CLIENT_CERT_RECEIVED
-    {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_RECEIVED},
-  #else
-    {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, 186},
+    {"NO_CLIENT_CERT_METHOD", 20, 331},
   #endif
   #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
     {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED},
   #else
-    {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187},
+    {"NO_COMPRESSION_SPECIFIED", 20, 187},
+  #endif
+  #ifdef SSL_R_NO_COOKIE_CALLBACK_SET
+    {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET},
+  #else
+    {"NO_COOKIE_CALLBACK_SET", 20, 287},
   #endif
   #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
     {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
   #else
-    {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330},
+    {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330},
   #endif
   #ifdef SSL_R_NO_METHOD_SPECIFIED
     {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
   #else
-    {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188},
+    {"NO_METHOD_SPECIFIED", 20, 188},
   #endif
   #ifdef SSL_R_NO_PEM_EXTENSIONS
     {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
   #else
-    {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389},
-  #endif
-  #ifdef SSL_R_NO_PRIVATEKEY
-    {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY},
-  #else
-    {"NO_PRIVATEKEY", ERR_LIB_SSL, 189},
+    {"NO_PEM_EXTENSIONS", 20, 389},
   #endif
   #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
     {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
   #else
-    {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190},
+    {"NO_PRIVATE_KEY_ASSIGNED", 20, 190},
   #endif
   #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
     {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
   #else
-    {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191},
-  #endif
-  #ifdef SSL_R_NO_PUBLICKEY
-    {"NO_PUBLICKEY", ERR_LIB_SSL, SSL_R_NO_PUBLICKEY},
-  #else
-    {"NO_PUBLICKEY", ERR_LIB_SSL, 192},
+    {"NO_PROTOCOLS_AVAILABLE", 20, 191},
   #endif
   #ifdef SSL_R_NO_RENEGOTIATION
     {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
   #else
-    {"NO_RENEGOTIATION", ERR_LIB_SSL, 339},
+    {"NO_RENEGOTIATION", 20, 339},
   #endif
   #ifdef SSL_R_NO_REQUIRED_DIGEST
     {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
   #else
-    {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324},
+    {"NO_REQUIRED_DIGEST", 20, 324},
   #endif
   #ifdef SSL_R_NO_SHARED_CIPHER
     {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
   #else
-    {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193},
+    {"NO_SHARED_CIPHER", 20, 193},
   #endif
-  #ifdef SSL_R_NO_SHARED_SIGATURE_ALGORITHMS
-    {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGATURE_ALGORITHMS},
+  #ifdef SSL_R_NO_SHARED_GROUPS
+    {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS},
   #else
-    {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, 376},
+    {"NO_SHARED_GROUPS", 20, 410},
+  #endif
+  #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS
+    {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS},
+  #else
+    {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376},
   #endif
   #ifdef SSL_R_NO_SRTP_PROFILES
     {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
   #else
-    {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359},
+    {"NO_SRTP_PROFILES", 20, 359},
   #endif
-  #ifdef SSL_R_NO_VERIFY_CALLBACK
-    {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK},
+  #ifdef SSL_R_NO_SUITABLE_KEY_SHARE
+    {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE},
   #else
-    {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, 194},
+    {"NO_SUITABLE_KEY_SHARE", 20, 101},
+  #endif
+  #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM
+    {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM},
+  #else
+    {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118},
+  #endif
+  #ifdef SSL_R_NO_VALID_SCTS
+    {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS},
+  #else
+    {"NO_VALID_SCTS", 20, 216},
+  #endif
+  #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK
+    {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK},
+  #else
+    {"NO_VERIFY_COOKIE_CALLBACK", 20, 403},
   #endif
   #ifdef SSL_R_NULL_SSL_CTX
     {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
   #else
-    {"NULL_SSL_CTX", ERR_LIB_SSL, 195},
+    {"NULL_SSL_CTX", 20, 195},
   #endif
   #ifdef SSL_R_NULL_SSL_METHOD_PASSED
     {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
   #else
-    {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196},
+    {"NULL_SSL_METHOD_PASSED", 20, 196},
   #endif
   #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
     {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
   #else
-    {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197},
+    {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197},
   #endif
   #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
     {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
   #else
-    {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344},
+    {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344},
   #endif
   #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE
     {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE},
   #else
-    {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387},
+    {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 387},
   #endif
   #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE
     {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE},
   #else
-    {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379},
+    {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 379},
   #endif
   #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE
     {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE},
   #else
-    {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297},
+    {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", 20, 297},
   #endif
   #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG
     {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG},
   #else
-    {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327},
+    {"OPAQUE_PRF_INPUT_TOO_LONG", 20, 327},
+  #endif
+  #ifdef SSL_R_OVERFLOW_ERROR
+    {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR},
+  #else
+    {"OVERFLOW_ERROR", 20, 237},
   #endif
   #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
     {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
   #else
-    {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198},
+    {"PACKET_LENGTH_TOO_LONG", 20, 198},
   #endif
   #ifdef SSL_R_PARSE_TLSEXT
     {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
   #else
-    {"PARSE_TLSEXT", ERR_LIB_SSL, 227},
+    {"PARSE_TLSEXT", 20, 227},
   #endif
   #ifdef SSL_R_PATH_TOO_LONG
     {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
   #else
-    {"PATH_TOO_LONG", ERR_LIB_SSL, 270},
+    {"PATH_TOO_LONG", 20, 270},
   #endif
   #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
     {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
   #else
-    {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199},
-  #endif
-  #ifdef SSL_R_PEER_ERROR
-    {"PEER_ERROR", ERR_LIB_SSL, SSL_R_PEER_ERROR},
-  #else
-    {"PEER_ERROR", ERR_LIB_SSL, 200},
-  #endif
-  #ifdef SSL_R_PEER_ERROR_CERTIFICATE
-    {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_CERTIFICATE},
-  #else
-    {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, 201},
-  #endif
-  #ifdef SSL_R_PEER_ERROR_NO_CERTIFICATE
-    {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CERTIFICATE},
-  #else
-    {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, 202},
-  #endif
-  #ifdef SSL_R_PEER_ERROR_NO_CIPHER
-    {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CIPHER},
-  #else
-    {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, 203},
-  #endif
-  #ifdef SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE
-    {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE},
-  #else
-    {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204},
+    {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199},
   #endif
   #ifdef SSL_R_PEM_NAME_BAD_PREFIX
     {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
   #else
-    {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391},
+    {"PEM_NAME_BAD_PREFIX", 20, 391},
   #endif
   #ifdef SSL_R_PEM_NAME_TOO_SHORT
     {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
   #else
-    {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392},
+    {"PEM_NAME_TOO_SHORT", 20, 392},
   #endif
-  #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG
-    {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG},
+  #ifdef SSL_R_PIPELINE_FAILURE
+    {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE},
   #else
-    {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, 205},
+    {"PIPELINE_FAILURE", 20, 406},
   #endif
-  #ifdef SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS
-    {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS},
+  #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR
+    {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR},
   #else
-    {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, 206},
+    {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278},
+  #endif
+  #ifdef SSL_R_PRIVATE_KEY_MISMATCH
+    {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH},
+  #else
+    {"PRIVATE_KEY_MISMATCH", 20, 288},
   #endif
   #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
     {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
   #else
-    {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207},
+    {"PROTOCOL_IS_SHUTDOWN", 20, 207},
   #endif
   #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
     {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
   #else
-    {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223},
+    {"PSK_IDENTITY_NOT_FOUND", 20, 223},
   #endif
   #ifdef SSL_R_PSK_NO_CLIENT_CB
     {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
   #else
-    {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224},
+    {"PSK_NO_CLIENT_CB", 20, 224},
   #endif
   #ifdef SSL_R_PSK_NO_SERVER_CB
     {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
   #else
-    {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225},
-  #endif
-  #ifdef SSL_R_PUBLIC_KEY_ENCRYPT_ERROR
-    {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_ENCRYPT_ERROR},
-  #else
-    {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, 208},
-  #endif
-  #ifdef SSL_R_PUBLIC_KEY_IS_NOT_RSA
-    {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_IS_NOT_RSA},
-  #else
-    {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, 209},
-  #endif
-  #ifdef SSL_R_PUBLIC_KEY_NOT_RSA
-    {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_NOT_RSA},
-  #else
-    {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, 210},
+    {"PSK_NO_SERVER_CB", 20, 225},
   #endif
   #ifdef SSL_R_READ_BIO_NOT_SET
     {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
   #else
-    {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211},
+    {"READ_BIO_NOT_SET", 20, 211},
   #endif
   #ifdef SSL_R_READ_TIMEOUT_EXPIRED
     {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
   #else
-    {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312},
-  #endif
-  #ifdef SSL_R_READ_WRONG_PACKET_TYPE
-    {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, SSL_R_READ_WRONG_PACKET_TYPE},
-  #else
-    {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, 212},
+    {"READ_TIMEOUT_EXPIRED", 20, 312},
   #endif
   #ifdef SSL_R_RECORD_LENGTH_MISMATCH
     {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
   #else
-    {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213},
-  #endif
-  #ifdef SSL_R_RECORD_TOO_LARGE
-    {"RECORD_TOO_LARGE", ERR_LIB_SSL, SSL_R_RECORD_TOO_LARGE},
-  #else
-    {"RECORD_TOO_LARGE", ERR_LIB_SSL, 214},
+    {"RECORD_LENGTH_MISMATCH", 20, 213},
   #endif
   #ifdef SSL_R_RECORD_TOO_SMALL
     {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
   #else
-    {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298},
+    {"RECORD_TOO_SMALL", 20, 298},
   #endif
   #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
     {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG},
   #else
-    {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335},
+    {"RENEGOTIATE_EXT_TOO_LONG", 20, 335},
   #endif
   #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
     {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR},
   #else
-    {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336},
+    {"RENEGOTIATION_ENCODING_ERR", 20, 336},
   #endif
   #ifdef SSL_R_RENEGOTIATION_MISMATCH
     {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
   #else
-    {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337},
+    {"RENEGOTIATION_MISMATCH", 20, 337},
+  #endif
+  #ifdef SSL_R_REQUEST_PENDING
+    {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING},
+  #else
+    {"REQUEST_PENDING", 20, 285},
+  #endif
+  #ifdef SSL_R_REQUEST_SENT
+    {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT},
+  #else
+    {"REQUEST_SENT", 20, 286},
   #endif
   #ifdef SSL_R_REQUIRED_CIPHER_MISSING
     {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
   #else
-    {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215},
+    {"REQUIRED_CIPHER_MISSING", 20, 215},
   #endif
-  #ifdef SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING
-    {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING},
+  #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING
+    {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING},
   #else
-    {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342},
-  #endif
-  #ifdef SSL_R_REUSE_CERT_LENGTH_NOT_ZERO
-    {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_LENGTH_NOT_ZERO},
-  #else
-    {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, 216},
-  #endif
-  #ifdef SSL_R_REUSE_CERT_TYPE_NOT_ZERO
-    {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_TYPE_NOT_ZERO},
-  #else
-    {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, 217},
-  #endif
-  #ifdef SSL_R_REUSE_CIPHER_LIST_NOT_ZERO
-    {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CIPHER_LIST_NOT_ZERO},
-  #else
-    {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, 218},
+    {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342},
   #endif
   #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
     {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
   #else
-    {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345},
+    {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345},
+  #endif
+  #ifdef SSL_R_SCT_VERIFICATION_FAILED
+    {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED},
+  #else
+    {"SCT_VERIFICATION_FAILED", 20, 208},
   #endif
   #ifdef SSL_R_SERVERHELLO_TLSEXT
     {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
   #else
-    {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275},
+    {"SERVERHELLO_TLSEXT", 20, 275},
   #endif
   #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
     {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
   #else
-    {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277},
+    {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277},
   #endif
-  #ifdef SSL_R_SHORT_READ
-    {"SHORT_READ", ERR_LIB_SSL, SSL_R_SHORT_READ},
+  #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT
+    {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT},
   #else
-    {"SHORT_READ", ERR_LIB_SSL, 219},
+    {"SHUTDOWN_WHILE_IN_INIT", 20, 407},
   #endif
   #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
     {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
   #else
-    {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360},
+    {"SIGNATURE_ALGORITHMS_ERROR", 20, 360},
   #endif
   #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
     {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
   #else
-    {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220},
+    {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220},
   #endif
   #ifdef SSL_R_SRP_A_CALC
     {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
   #else
-    {"SRP_A_CALC", ERR_LIB_SSL, 361},
+    {"SRP_A_CALC", 20, 361},
   #endif
   #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
     {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
   #else
-    {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362},
+    {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362},
   #endif
   #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
     {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
   #else
-    {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363},
+    {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363},
   #endif
   #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
     {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
   #else
-    {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364},
-  #endif
-  #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE
-    {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, SSL_R_SSL23_DOING_SESSION_ID_REUSE},
-  #else
-    {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, 221},
+    {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364},
   #endif
   #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG
     {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG},
   #else
-    {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299},
+    {"SSL2_CONNECTION_ID_TOO_LONG", 20, 299},
   #endif
   #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT
     {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT},
   #else
-    {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321},
+    {"SSL3_EXT_INVALID_ECPOINTFORMAT", 20, 321},
+  #endif
+  #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH
+    {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH},
+  #else
+    {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232},
   #endif
   #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
     {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME},
   #else
-    {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319},
+    {"SSL3_EXT_INVALID_SERVERNAME", 20, 319},
   #endif
   #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
     {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
   #else
-    {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320},
+    {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320},
   #endif
   #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
     {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG},
   #else
-    {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300},
-  #endif
-  #ifdef SSL_R_SSL3_SESSION_ID_TOO_SHORT
-    {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_SHORT},
-  #else
-    {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, 222},
+    {"SSL3_SESSION_ID_TOO_LONG", 20, 300},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
     {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
   #else
-    {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042},
+    {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
     {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
   #else
-    {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020},
+    {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
     {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
   #else
-    {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045},
+    {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
     {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
   #else
-    {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044},
+    {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
     {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
   #else
-    {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046},
+    {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
     {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
   #else
-    {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030},
+    {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
     {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
   #else
-    {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040},
+    {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
     {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
   #else
-    {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047},
+    {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
     {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
   #else
-    {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041},
+    {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
     {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
   #else
-    {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010},
+    {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010},
   #endif
   #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
     {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
   #else
-    {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043},
+    {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043},
+  #endif
+  #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY
+    {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY},
+  #else
+    {"SSL_COMMAND_SECTION_EMPTY", 20, 117},
+  #endif
+  #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND
+    {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND},
+  #else
+    {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125},
   #endif
   #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
     {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
   #else
-    {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228},
+    {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228},
   #endif
   #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
     {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
   #else
-    {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229},
+    {"SSL_HANDSHAKE_FAILURE", 20, 229},
   #endif
   #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
     {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
   #else
-    {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230},
+    {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230},
   #endif
   #ifdef SSL_R_SSL_NEGATIVE_LENGTH
     {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
   #else
-    {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372},
+    {"SSL_NEGATIVE_LENGTH", 20, 372},
+  #endif
+  #ifdef SSL_R_SSL_SECTION_EMPTY
+    {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY},
+  #else
+    {"SSL_SECTION_EMPTY", 20, 126},
+  #endif
+  #ifdef SSL_R_SSL_SECTION_NOT_FOUND
+    {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND},
+  #else
+    {"SSL_SECTION_NOT_FOUND", 20, 136},
   #endif
   #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
     {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
   #else
-    {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301},
+    {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301},
   #endif
   #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
     {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
   #else
-    {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302},
+    {"SSL_SESSION_ID_CONFLICT", 20, 302},
   #endif
   #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
     {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
   #else
-    {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273},
+    {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273},
   #endif
   #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
     {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
   #else
-    {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303},
+    {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303},
   #endif
-  #ifdef SSL_R_SSL_SESSION_ID_IS_DIFFERENT
-    {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_IS_DIFFERENT},
+  #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG
+    {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG},
   #else
-    {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, 231},
+    {"SSL_SESSION_ID_TOO_LONG", 20, 408},
+  #endif
+  #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH
+    {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH},
+  #else
+    {"SSL_SESSION_VERSION_MISMATCH", 20, 210},
+  #endif
+  #ifdef SSL_R_STILL_IN_INIT
+    {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT},
+  #else
+    {"STILL_IN_INIT", 20, 121},
+  #endif
+  #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
+    {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED},
+  #else
+    {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116},
+  #endif
+  #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION
+    {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION},
+  #else
+    {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
     {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED},
   #else
-    {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049},
+    {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
     {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR},
   #else
-    {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050},
+    {"TLSV1_ALERT_DECODE_ERROR", 20, 1050},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
     {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
   #else
-    {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021},
+    {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
     {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
   #else
-    {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051},
+    {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
     {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
   #else
-    {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060},
+    {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
     {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
   #else
-    {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086},
+    {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
     {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
   #else
-    {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071},
+    {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
     {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
   #else
-    {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080},
+    {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
     {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
   #else
-    {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100},
+    {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
     {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
   #else
-    {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070},
+    {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
     {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
   #else
-    {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022},
+    {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
     {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
   #else
-    {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048},
+    {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048},
   #endif
   #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
     {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED},
   #else
-    {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090},
+    {"TLSV1_ALERT_USER_CANCELLED", 20, 1090},
   #endif
   #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
     {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
   #else
-    {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114},
+    {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114},
   #endif
   #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
     {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
   #else
-    {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113},
+    {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113},
   #endif
   #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
     {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
   #else
-    {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111},
+    {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111},
   #endif
   #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
     {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
   #else
-    {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112},
+    {"TLSV1_UNRECOGNIZED_NAME", 20, 1112},
   #endif
   #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
     {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
   #else
-    {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110},
-  #endif
-  #ifdef SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER
-    {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER},
-  #else
-    {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232},
+    {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110},
   #endif
   #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT
     {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT},
   #else
-    {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365},
+    {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365},
   #endif
   #ifdef SSL_R_TLS_HEARTBEAT_PENDING
     {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING},
   #else
-    {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366},
+    {"TLS_HEARTBEAT_PENDING", 20, 366},
   #endif
   #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
     {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
   #else
-    {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367},
+    {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367},
   #endif
   #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
     {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
   #else
-    {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157},
+    {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157},
   #endif
-  #ifdef SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST
-    {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST},
+  #ifdef SSL_R_TOO_MANY_KEY_UPDATES
+    {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES},
   #else
-    {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, 233},
+    {"TOO_MANY_KEY_UPDATES", 20, 132},
   #endif
-  #ifdef SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG
-    {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG},
+  #ifdef SSL_R_TOO_MANY_WARN_ALERTS
+    {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS},
   #else
-    {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 234},
+    {"TOO_MANY_WARN_ALERTS", 20, 409},
   #endif
-  #ifdef SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER
-    {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER},
+  #ifdef SSL_R_TOO_MUCH_EARLY_DATA
+    {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA},
   #else
-    {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, 235},
-  #endif
-  #ifdef SSL_R_UNABLE_TO_DECODE_DH_CERTS
-    {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_DH_CERTS},
-  #else
-    {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, 236},
+    {"TOO_MUCH_EARLY_DATA", 20, 164},
   #endif
   #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS
     {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS},
   #else
-    {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313},
-  #endif
-  #ifdef SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY
-    {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY},
-  #else
-    {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, 237},
-  #endif
-  #ifdef SSL_R_UNABLE_TO_FIND_DH_PARAMETERS
-    {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_DH_PARAMETERS},
-  #else
-    {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, 238},
+    {"UNABLE_TO_DECODE_ECDH_CERTS", 20, 313},
   #endif
   #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
     {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
   #else
-    {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314},
+    {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314},
   #endif
   #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
     {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
   #else
-    {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239},
-  #endif
-  #ifdef SSL_R_UNABLE_TO_FIND_SSL_METHOD
-    {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_SSL_METHOD},
-  #else
-    {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, 240},
-  #endif
-  #ifdef SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES
-    {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES},
-  #else
-    {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, 241},
+    {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239},
   #endif
   #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
     {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
   #else
-    {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242},
+    {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242},
   #endif
   #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
     {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
   #else
-    {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243},
+    {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243},
+  #endif
+  #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE
+    {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE},
+  #else
+    {"UNEXPECTED_CCS_MESSAGE", 20, 262},
+  #endif
+  #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA
+    {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA},
+  #else
+    {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178},
   #endif
   #ifdef SSL_R_UNEXPECTED_MESSAGE
     {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
   #else
-    {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244},
+    {"UNEXPECTED_MESSAGE", 20, 244},
   #endif
   #ifdef SSL_R_UNEXPECTED_RECORD
     {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
   #else
-    {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245},
+    {"UNEXPECTED_RECORD", 20, 245},
   #endif
   #ifdef SSL_R_UNINITIALIZED
     {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
   #else
-    {"UNINITIALIZED", ERR_LIB_SSL, 276},
+    {"UNINITIALIZED", 20, 276},
   #endif
   #ifdef SSL_R_UNKNOWN_ALERT_TYPE
     {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
   #else
-    {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246},
+    {"UNKNOWN_ALERT_TYPE", 20, 246},
   #endif
   #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
     {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE},
   #else
-    {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247},
+    {"UNKNOWN_CERTIFICATE_TYPE", 20, 247},
   #endif
   #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
     {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
   #else
-    {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248},
+    {"UNKNOWN_CIPHER_RETURNED", 20, 248},
   #endif
   #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
     {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
   #else
-    {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249},
+    {"UNKNOWN_CIPHER_TYPE", 20, 249},
   #endif
   #ifdef SSL_R_UNKNOWN_CMD_NAME
     {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
   #else
-    {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386},
+    {"UNKNOWN_CMD_NAME", 20, 386},
+  #endif
+  #ifdef SSL_R_UNKNOWN_COMMAND
+    {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND},
+  #else
+    {"UNKNOWN_COMMAND", 20, 139},
   #endif
   #ifdef SSL_R_UNKNOWN_DIGEST
     {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
   #else
-    {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368},
+    {"UNKNOWN_DIGEST", 20, 368},
   #endif
   #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
     {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
   #else
-    {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250},
+    {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250},
   #endif
   #ifdef SSL_R_UNKNOWN_PKEY_TYPE
     {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
   #else
-    {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251},
+    {"UNKNOWN_PKEY_TYPE", 20, 251},
   #endif
   #ifdef SSL_R_UNKNOWN_PROTOCOL
     {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
   #else
-    {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252},
-  #endif
-  #ifdef SSL_R_UNKNOWN_REMOTE_ERROR_TYPE
-    {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_REMOTE_ERROR_TYPE},
-  #else
-    {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, 253},
+    {"UNKNOWN_PROTOCOL", 20, 252},
   #endif
   #ifdef SSL_R_UNKNOWN_SSL_VERSION
     {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
   #else
-    {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254},
+    {"UNKNOWN_SSL_VERSION", 20, 254},
   #endif
   #ifdef SSL_R_UNKNOWN_STATE
     {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
   #else
-    {"UNKNOWN_STATE", ERR_LIB_SSL, 255},
+    {"UNKNOWN_STATE", 20, 255},
   #endif
   #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
     {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
   #else
-    {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338},
+    {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338},
   #endif
-  #ifdef SSL_R_UNSUPPORTED_CIPHER
-    {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_UNSUPPORTED_CIPHER},
+  #ifdef SSL_R_UNSOLICITED_EXTENSION
+    {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION},
   #else
-    {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, 256},
+    {"UNSOLICITED_EXTENSION", 20, 217},
   #endif
   #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
     {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
   #else
-    {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257},
+    {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257},
   #endif
   #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE
     {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE},
   #else
-    {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326},
+    {"UNSUPPORTED_DIGEST_TYPE", 20, 326},
   #endif
   #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
     {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
   #else
-    {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315},
+    {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315},
   #endif
   #ifdef SSL_R_UNSUPPORTED_PROTOCOL
     {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
   #else
-    {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258},
+    {"UNSUPPORTED_PROTOCOL", 20, 258},
   #endif
   #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
     {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
   #else
-    {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259},
+    {"UNSUPPORTED_SSL_VERSION", 20, 259},
   #endif
   #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
     {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
   #else
-    {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329},
+    {"UNSUPPORTED_STATUS_TYPE", 20, 329},
   #endif
   #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
     {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
   #else
-    {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369},
+    {"USE_SRTP_NOT_NEGOTIATED", 20, 369},
+  #endif
+  #ifdef SSL_R_VERSION_TOO_HIGH
+    {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH},
+  #else
+    {"VERSION_TOO_HIGH", 20, 166},
   #endif
   #ifdef SSL_R_VERSION_TOO_LOW
     {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
   #else
-    {"VERSION_TOO_LOW", ERR_LIB_SSL, 396},
-  #endif
-  #ifdef SSL_R_WRITE_BIO_NOT_SET
-    {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET},
-  #else
-    {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260},
+    {"VERSION_TOO_LOW", 20, 396},
   #endif
   #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
     {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
   #else
-    {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383},
+    {"WRONG_CERTIFICATE_TYPE", 20, 383},
   #endif
   #ifdef SSL_R_WRONG_CIPHER_RETURNED
     {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
   #else
-    {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261},
+    {"WRONG_CIPHER_RETURNED", 20, 261},
   #endif
   #ifdef SSL_R_WRONG_CURVE
     {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
   #else
-    {"WRONG_CURVE", ERR_LIB_SSL, 378},
-  #endif
-  #ifdef SSL_R_WRONG_MESSAGE_TYPE
-    {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE},
-  #else
-    {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, 262},
-  #endif
-  #ifdef SSL_R_WRONG_NUMBER_OF_KEY_BITS
-    {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, SSL_R_WRONG_NUMBER_OF_KEY_BITS},
-  #else
-    {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, 263},
+    {"WRONG_CURVE", 20, 378},
   #endif
   #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
     {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
   #else
-    {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264},
+    {"WRONG_SIGNATURE_LENGTH", 20, 264},
   #endif
   #ifdef SSL_R_WRONG_SIGNATURE_SIZE
     {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
   #else
-    {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265},
+    {"WRONG_SIGNATURE_SIZE", 20, 265},
   #endif
   #ifdef SSL_R_WRONG_SIGNATURE_TYPE
     {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
   #else
-    {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370},
+    {"WRONG_SIGNATURE_TYPE", 20, 370},
   #endif
   #ifdef SSL_R_WRONG_SSL_VERSION
     {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
   #else
-    {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266},
+    {"WRONG_SSL_VERSION", 20, 266},
   #endif
   #ifdef SSL_R_WRONG_VERSION_NUMBER
     {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
   #else
-    {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267},
+    {"WRONG_VERSION_NUMBER", 20, 267},
   #endif
   #ifdef SSL_R_X509_LIB
     {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
   #else
-    {"X509_LIB", ERR_LIB_SSL, 268},
+    {"X509_LIB", 20, 268},
   #endif
   #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
     {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
   #else
-    {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269},
+    {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269},
+  #endif
+  #ifdef TS_R_BAD_PKCS7_TYPE
+    {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE},
+  #else
+    {"BAD_PKCS7_TYPE", 47, 132},
+  #endif
+  #ifdef TS_R_BAD_TYPE
+    {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE},
+  #else
+    {"BAD_TYPE", 47, 133},
+  #endif
+  #ifdef TS_R_CANNOT_LOAD_CERT
+    {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT},
+  #else
+    {"CANNOT_LOAD_CERT", 47, 137},
+  #endif
+  #ifdef TS_R_CANNOT_LOAD_KEY
+    {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY},
+  #else
+    {"CANNOT_LOAD_KEY", 47, 138},
+  #endif
+  #ifdef TS_R_CERTIFICATE_VERIFY_ERROR
+    {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR},
+  #else
+    {"CERTIFICATE_VERIFY_ERROR", 47, 100},
+  #endif
+  #ifdef TS_R_COULD_NOT_SET_ENGINE
+    {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE},
+  #else
+    {"COULD_NOT_SET_ENGINE", 47, 127},
+  #endif
+  #ifdef TS_R_COULD_NOT_SET_TIME
+    {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME},
+  #else
+    {"COULD_NOT_SET_TIME", 47, 115},
+  #endif
+  #ifdef TS_R_DETACHED_CONTENT
+    {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT},
+  #else
+    {"DETACHED_CONTENT", 47, 134},
+  #endif
+  #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR
+    {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR},
+  #else
+    {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116},
+  #endif
+  #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR
+    {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR},
+  #else
+    {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139},
+  #endif
+  #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR
+    {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+  #else
+    {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101},
+  #endif
+  #ifdef TS_R_INVALID_NULL_POINTER
+    {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER},
+  #else
+    {"INVALID_NULL_POINTER", 47, 102},
+  #endif
+  #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE
+    {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE},
+  #else
+    {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117},
+  #endif
+  #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH
+    {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH},
+  #else
+    {"MESSAGE_IMPRINT_MISMATCH", 47, 103},
+  #endif
+  #ifdef TS_R_NONCE_MISMATCH
+    {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH},
+  #else
+    {"NONCE_MISMATCH", 47, 104},
+  #endif
+  #ifdef TS_R_NONCE_NOT_RETURNED
+    {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED},
+  #else
+    {"NONCE_NOT_RETURNED", 47, 105},
+  #endif
+  #ifdef TS_R_NO_CONTENT
+    {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT},
+  #else
+    {"NO_CONTENT", 47, 106},
+  #endif
+  #ifdef TS_R_NO_TIME_STAMP_TOKEN
+    {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN},
+  #else
+    {"NO_TIME_STAMP_TOKEN", 47, 107},
+  #endif
+  #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR
+    {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR},
+  #else
+    {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118},
+  #endif
+  #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR
+    {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR},
+  #else
+    {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119},
+  #endif
+  #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED
+    {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED},
+  #else
+    {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129},
+  #endif
+  #ifdef TS_R_POLICY_MISMATCH
+    {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH},
+  #else
+    {"POLICY_MISMATCH", 47, 108},
+  #endif
+  #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+  #else
+    {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120},
+  #endif
+  #ifdef TS_R_RESPONSE_SETUP_ERROR
+    {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR},
+  #else
+    {"RESPONSE_SETUP_ERROR", 47, 121},
+  #endif
+  #ifdef TS_R_SIGNATURE_FAILURE
+    {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE},
+  #else
+    {"SIGNATURE_FAILURE", 47, 109},
+  #endif
+  #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER
+    {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER},
+  #else
+    {"THERE_MUST_BE_ONE_SIGNER", 47, 110},
+  #endif
+  #ifdef TS_R_TIME_SYSCALL_ERROR
+    {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR},
+  #else
+    {"TIME_SYSCALL_ERROR", 47, 122},
+  #endif
+  #ifdef TS_R_TOKEN_NOT_PRESENT
+    {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT},
+  #else
+    {"TOKEN_NOT_PRESENT", 47, 130},
+  #endif
+  #ifdef TS_R_TOKEN_PRESENT
+    {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT},
+  #else
+    {"TOKEN_PRESENT", 47, 131},
+  #endif
+  #ifdef TS_R_TSA_NAME_MISMATCH
+    {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH},
+  #else
+    {"TSA_NAME_MISMATCH", 47, 111},
+  #endif
+  #ifdef TS_R_TSA_UNTRUSTED
+    {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED},
+  #else
+    {"TSA_UNTRUSTED", 47, 112},
+  #endif
+  #ifdef TS_R_TST_INFO_SETUP_ERROR
+    {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR},
+  #else
+    {"TST_INFO_SETUP_ERROR", 47, 123},
+  #endif
+  #ifdef TS_R_TS_DATASIGN
+    {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN},
+  #else
+    {"TS_DATASIGN", 47, 124},
+  #endif
+  #ifdef TS_R_UNACCEPTABLE_POLICY
+    {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY},
+  #else
+    {"UNACCEPTABLE_POLICY", 47, 125},
+  #endif
+  #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM
+    {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM},
+  #else
+    {"UNSUPPORTED_MD_ALGORITHM", 47, 126},
+  #endif
+  #ifdef TS_R_UNSUPPORTED_VERSION
+    {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION},
+  #else
+    {"UNSUPPORTED_VERSION", 47, 113},
+  #endif
+  #ifdef TS_R_VAR_BAD_VALUE
+    {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE},
+  #else
+    {"VAR_BAD_VALUE", 47, 135},
+  #endif
+  #ifdef TS_R_VAR_LOOKUP_FAILURE
+    {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE},
+  #else
+    {"VAR_LOOKUP_FAILURE", 47, 136},
+  #endif
+  #ifdef TS_R_WRONG_CONTENT_TYPE
+    {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE},
+  #else
+    {"WRONG_CONTENT_TYPE", 47, 114},
+  #endif
+  #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS
+    {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS},
+  #else
+    {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104},
+  #endif
+  #ifdef UI_R_INDEX_TOO_LARGE
+    {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE},
+  #else
+    {"INDEX_TOO_LARGE", 40, 102},
+  #endif
+  #ifdef UI_R_INDEX_TOO_SMALL
+    {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL},
+  #else
+    {"INDEX_TOO_SMALL", 40, 103},
+  #endif
+  #ifdef UI_R_NO_RESULT_BUFFER
+    {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER},
+  #else
+    {"NO_RESULT_BUFFER", 40, 105},
+  #endif
+  #ifdef UI_R_PROCESSING_ERROR
+    {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR},
+  #else
+    {"PROCESSING_ERROR", 40, 107},
+  #endif
+  #ifdef UI_R_RESULT_TOO_LARGE
+    {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE},
+  #else
+    {"RESULT_TOO_LARGE", 40, 100},
+  #endif
+  #ifdef UI_R_RESULT_TOO_SMALL
+    {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL},
+  #else
+    {"RESULT_TOO_SMALL", 40, 101},
+  #endif
+  #ifdef UI_R_SYSASSIGN_ERROR
+    {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR},
+  #else
+    {"SYSASSIGN_ERROR", 40, 109},
+  #endif
+  #ifdef UI_R_SYSDASSGN_ERROR
+    {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR},
+  #else
+    {"SYSDASSGN_ERROR", 40, 110},
+  #endif
+  #ifdef UI_R_SYSQIOW_ERROR
+    {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR},
+  #else
+    {"SYSQIOW_ERROR", 40, 111},
+  #endif
+  #ifdef UI_R_UNKNOWN_CONTROL_COMMAND
+    {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND},
+  #else
+    {"UNKNOWN_CONTROL_COMMAND", 40, 106},
+  #endif
+  #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE
+    {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE},
+  #else
+    {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108},
+  #endif
+  #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED
+    {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED},
+  #else
+    {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112},
+  #endif
+  #ifdef X509V3_R_BAD_IP_ADDRESS
+    {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS},
+  #else
+    {"BAD_IP_ADDRESS", 34, 118},
+  #endif
+  #ifdef X509V3_R_BAD_OBJECT
+    {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT},
+  #else
+    {"BAD_OBJECT", 34, 119},
+  #endif
+  #ifdef X509V3_R_BN_DEC2BN_ERROR
+    {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR},
+  #else
+    {"BN_DEC2BN_ERROR", 34, 100},
+  #endif
+  #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR
+    {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR},
+  #else
+    {"BN_TO_ASN1_INTEGER_ERROR", 34, 101},
+  #endif
+  #ifdef X509V3_R_DIRNAME_ERROR
+    {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR},
+  #else
+    {"DIRNAME_ERROR", 34, 149},
+  #endif
+  #ifdef X509V3_R_DISTPOINT_ALREADY_SET
+    {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET},
+  #else
+    {"DISTPOINT_ALREADY_SET", 34, 160},
+  #endif
+  #ifdef X509V3_R_DUPLICATE_ZONE_ID
+    {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID},
+  #else
+    {"DUPLICATE_ZONE_ID", 34, 133},
+  #endif
+  #ifdef X509V3_R_ERROR_CONVERTING_ZONE
+    {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE},
+  #else
+    {"ERROR_CONVERTING_ZONE", 34, 131},
+  #endif
+  #ifdef X509V3_R_ERROR_CREATING_EXTENSION
+    {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION},
+  #else
+    {"ERROR_CREATING_EXTENSION", 34, 144},
+  #endif
+  #ifdef X509V3_R_ERROR_IN_EXTENSION
+    {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION},
+  #else
+    {"ERROR_IN_EXTENSION", 34, 128},
+  #endif
+  #ifdef X509V3_R_EXPECTED_A_SECTION_NAME
+    {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME},
+  #else
+    {"EXPECTED_A_SECTION_NAME", 34, 137},
+  #endif
+  #ifdef X509V3_R_EXTENSION_EXISTS
+    {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS},
+  #else
+    {"EXTENSION_EXISTS", 34, 145},
+  #endif
+  #ifdef X509V3_R_EXTENSION_NAME_ERROR
+    {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR},
+  #else
+    {"EXTENSION_NAME_ERROR", 34, 115},
+  #endif
+  #ifdef X509V3_R_EXTENSION_NOT_FOUND
+    {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND},
+  #else
+    {"EXTENSION_NOT_FOUND", 34, 102},
+  #endif
+  #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
+    {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED},
+  #else
+    {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103},
+  #endif
+  #ifdef X509V3_R_EXTENSION_VALUE_ERROR
+    {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR},
+  #else
+    {"EXTENSION_VALUE_ERROR", 34, 116},
+  #endif
+  #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION
+    {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION},
+  #else
+    {"ILLEGAL_EMPTY_EXTENSION", 34, 151},
+  #endif
+  #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG
+    {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG},
+  #else
+    {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152},
+  #endif
+  #ifdef X509V3_R_INVALID_ASNUMBER
+    {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER},
+  #else
+    {"INVALID_ASNUMBER", 34, 162},
+  #endif
+  #ifdef X509V3_R_INVALID_ASRANGE
+    {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE},
+  #else
+    {"INVALID_ASRANGE", 34, 163},
+  #endif
+  #ifdef X509V3_R_INVALID_BOOLEAN_STRING
+    {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING},
+  #else
+    {"INVALID_BOOLEAN_STRING", 34, 104},
+  #endif
+  #ifdef X509V3_R_INVALID_EXTENSION_STRING
+    {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING},
+  #else
+    {"INVALID_EXTENSION_STRING", 34, 105},
+  #endif
+  #ifdef X509V3_R_INVALID_INHERITANCE
+    {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE},
+  #else
+    {"INVALID_INHERITANCE", 34, 165},
+  #endif
+  #ifdef X509V3_R_INVALID_IPADDRESS
+    {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS},
+  #else
+    {"INVALID_IPADDRESS", 34, 166},
+  #endif
+  #ifdef X509V3_R_INVALID_MULTIPLE_RDNS
+    {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS},
+  #else
+    {"INVALID_MULTIPLE_RDNS", 34, 161},
+  #endif
+  #ifdef X509V3_R_INVALID_NAME
+    {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME},
+  #else
+    {"INVALID_NAME", 34, 106},
+  #endif
+  #ifdef X509V3_R_INVALID_NULL_ARGUMENT
+    {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT},
+  #else
+    {"INVALID_NULL_ARGUMENT", 34, 107},
+  #endif
+  #ifdef X509V3_R_INVALID_NULL_NAME
+    {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME},
+  #else
+    {"INVALID_NULL_NAME", 34, 108},
+  #endif
+  #ifdef X509V3_R_INVALID_NULL_VALUE
+    {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE},
+  #else
+    {"INVALID_NULL_VALUE", 34, 109},
+  #endif
+  #ifdef X509V3_R_INVALID_NUMBER
+    {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER},
+  #else
+    {"INVALID_NUMBER", 34, 140},
+  #endif
+  #ifdef X509V3_R_INVALID_NUMBERS
+    {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS},
+  #else
+    {"INVALID_NUMBERS", 34, 141},
+  #endif
+  #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER
+    {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER},
+  #else
+    {"INVALID_OBJECT_IDENTIFIER", 34, 110},
+  #endif
+  #ifdef X509V3_R_INVALID_OPTION
+    {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION},
+  #else
+    {"INVALID_OPTION", 34, 138},
+  #endif
+  #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER
+    {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER},
+  #else
+    {"INVALID_POLICY_IDENTIFIER", 34, 134},
+  #endif
+  #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING
+    {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING},
+  #else
+    {"INVALID_PROXY_POLICY_SETTING", 34, 153},
+  #endif
+  #ifdef X509V3_R_INVALID_PURPOSE
+    {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE},
+  #else
+    {"INVALID_PURPOSE", 34, 146},
+  #endif
+  #ifdef X509V3_R_INVALID_SAFI
+    {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI},
+  #else
+    {"INVALID_SAFI", 34, 164},
+  #endif
+  #ifdef X509V3_R_INVALID_SECTION
+    {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION},
+  #else
+    {"INVALID_SECTION", 34, 135},
+  #endif
+  #ifdef X509V3_R_INVALID_SYNTAX
+    {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX},
+  #else
+    {"INVALID_SYNTAX", 34, 143},
+  #endif
+  #ifdef X509V3_R_ISSUER_DECODE_ERROR
+    {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR},
+  #else
+    {"ISSUER_DECODE_ERROR", 34, 126},
+  #endif
+  #ifdef X509V3_R_MISSING_VALUE
+    {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE},
+  #else
+    {"MISSING_VALUE", 34, 124},
+  #endif
+  #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS
+    {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS},
+  #else
+    {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142},
+  #endif
+  #ifdef X509V3_R_NO_CONFIG_DATABASE
+    {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE},
+  #else
+    {"NO_CONFIG_DATABASE", 34, 136},
+  #endif
+  #ifdef X509V3_R_NO_ISSUER_CERTIFICATE
+    {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE},
+  #else
+    {"NO_ISSUER_CERTIFICATE", 34, 121},
+  #endif
+  #ifdef X509V3_R_NO_ISSUER_DETAILS
+    {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS},
+  #else
+    {"NO_ISSUER_DETAILS", 34, 127},
+  #endif
+  #ifdef X509V3_R_NO_POLICY_IDENTIFIER
+    {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER},
+  #else
+    {"NO_POLICY_IDENTIFIER", 34, 139},
+  #endif
+  #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED
+    {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED},
+  #else
+    {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154},
+  #endif
+  #ifdef X509V3_R_NO_PUBLIC_KEY
+    {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY},
+  #else
+    {"NO_PUBLIC_KEY", 34, 114},
+  #endif
+  #ifdef X509V3_R_NO_SUBJECT_DETAILS
+    {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS},
+  #else
+    {"NO_SUBJECT_DETAILS", 34, 125},
+  #endif
+  #ifdef X509V3_R_OPERATION_NOT_DEFINED
+    {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED},
+  #else
+    {"OPERATION_NOT_DEFINED", 34, 148},
+  #endif
+  #ifdef X509V3_R_OTHERNAME_ERROR
+    {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR},
+  #else
+    {"OTHERNAME_ERROR", 34, 147},
+  #endif
+  #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED
+    {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED},
+  #else
+    {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155},
+  #endif
+  #ifdef X509V3_R_POLICY_PATH_LENGTH
+    {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH},
+  #else
+    {"POLICY_PATH_LENGTH", 34, 156},
+  #endif
+  #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED
+    {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED},
+  #else
+    {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157},
+  #endif
+  #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY
+    {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY},
+  #else
+    {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159},
+  #endif
+  #ifdef X509V3_R_SECTION_NOT_FOUND
+    {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND},
+  #else
+    {"SECTION_NOT_FOUND", 34, 150},
+  #endif
+  #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS
+    {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS},
+  #else
+    {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122},
+  #endif
+  #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID
+    {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID},
+  #else
+    {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123},
+  #endif
+  #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT
+    {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT},
+  #else
+    {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111},
+  #endif
+  #ifdef X509V3_R_UNKNOWN_EXTENSION
+    {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION},
+  #else
+    {"UNKNOWN_EXTENSION", 34, 129},
+  #endif
+  #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME
+    {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME},
+  #else
+    {"UNKNOWN_EXTENSION_NAME", 34, 130},
+  #endif
+  #ifdef X509V3_R_UNKNOWN_OPTION
+    {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION},
+  #else
+    {"UNKNOWN_OPTION", 34, 120},
+  #endif
+  #ifdef X509V3_R_UNSUPPORTED_OPTION
+    {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION},
+  #else
+    {"UNSUPPORTED_OPTION", 34, 117},
+  #endif
+  #ifdef X509V3_R_UNSUPPORTED_TYPE
+    {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE},
+  #else
+    {"UNSUPPORTED_TYPE", 34, 167},
+  #endif
+  #ifdef X509V3_R_USER_TOO_LONG
+    {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG},
+  #else
+    {"USER_TOO_LONG", 34, 132},
   #endif
   #ifdef X509_R_AKID_MISMATCH
     {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
   #else
-    {"AKID_MISMATCH", ERR_LIB_X509, 110},
+    {"AKID_MISMATCH", 11, 110},
+  #endif
+  #ifdef X509_R_BAD_SELECTOR
+    {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR},
+  #else
+    {"BAD_SELECTOR", 11, 133},
   #endif
   #ifdef X509_R_BAD_X509_FILETYPE
     {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
   #else
-    {"BAD_X509_FILETYPE", ERR_LIB_X509, 100},
+    {"BAD_X509_FILETYPE", 11, 100},
   #endif
   #ifdef X509_R_BASE64_DECODE_ERROR
     {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
   #else
-    {"BASE64_DECODE_ERROR", ERR_LIB_X509, 118},
+    {"BASE64_DECODE_ERROR", 11, 118},
   #endif
   #ifdef X509_R_CANT_CHECK_DH_KEY
     {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
   #else
-    {"CANT_CHECK_DH_KEY", ERR_LIB_X509, 114},
+    {"CANT_CHECK_DH_KEY", 11, 114},
   #endif
   #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
     {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE},
   #else
-    {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101},
+    {"CERT_ALREADY_IN_HASH_TABLE", 11, 101},
   #endif
   #ifdef X509_R_CRL_ALREADY_DELTA
     {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
   #else
-    {"CRL_ALREADY_DELTA", ERR_LIB_X509, 127},
+    {"CRL_ALREADY_DELTA", 11, 127},
   #endif
   #ifdef X509_R_CRL_VERIFY_FAILURE
     {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
   #else
-    {"CRL_VERIFY_FAILURE", ERR_LIB_X509, 131},
+    {"CRL_VERIFY_FAILURE", 11, 131},
   #endif
   #ifdef X509_R_ERR_ASN1_LIB
     {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB},
   #else
-    {"ERR_ASN1_LIB", ERR_LIB_X509, 102},
+    {"ERR_ASN1_LIB", 11, 102},
   #endif
   #ifdef X509_R_IDP_MISMATCH
     {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
   #else
-    {"IDP_MISMATCH", ERR_LIB_X509, 128},
+    {"IDP_MISMATCH", 11, 128},
+  #endif
+  #ifdef X509_R_INVALID_ATTRIBUTES
+    {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES},
+  #else
+    {"INVALID_ATTRIBUTES", 11, 138},
   #endif
   #ifdef X509_R_INVALID_DIRECTORY
     {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
   #else
-    {"INVALID_DIRECTORY", ERR_LIB_X509, 113},
+    {"INVALID_DIRECTORY", 11, 113},
   #endif
   #ifdef X509_R_INVALID_FIELD_NAME
     {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
   #else
-    {"INVALID_FIELD_NAME", ERR_LIB_X509, 119},
+    {"INVALID_FIELD_NAME", 11, 119},
   #endif
   #ifdef X509_R_INVALID_TRUST
     {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
   #else
-    {"INVALID_TRUST", ERR_LIB_X509, 123},
+    {"INVALID_TRUST", 11, 123},
   #endif
   #ifdef X509_R_ISSUER_MISMATCH
     {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
   #else
-    {"ISSUER_MISMATCH", ERR_LIB_X509, 129},
+    {"ISSUER_MISMATCH", 11, 129},
   #endif
   #ifdef X509_R_KEY_TYPE_MISMATCH
     {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
   #else
-    {"KEY_TYPE_MISMATCH", ERR_LIB_X509, 115},
+    {"KEY_TYPE_MISMATCH", 11, 115},
   #endif
   #ifdef X509_R_KEY_VALUES_MISMATCH
     {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
   #else
-    {"KEY_VALUES_MISMATCH", ERR_LIB_X509, 116},
+    {"KEY_VALUES_MISMATCH", 11, 116},
   #endif
   #ifdef X509_R_LOADING_CERT_DIR
     {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
   #else
-    {"LOADING_CERT_DIR", ERR_LIB_X509, 103},
+    {"LOADING_CERT_DIR", 11, 103},
   #endif
   #ifdef X509_R_LOADING_DEFAULTS
     {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
   #else
-    {"LOADING_DEFAULTS", ERR_LIB_X509, 104},
+    {"LOADING_DEFAULTS", 11, 104},
   #endif
   #ifdef X509_R_METHOD_NOT_SUPPORTED
     {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
   #else
-    {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124},
+    {"METHOD_NOT_SUPPORTED", 11, 124},
+  #endif
+  #ifdef X509_R_NAME_TOO_LONG
+    {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG},
+  #else
+    {"NAME_TOO_LONG", 11, 134},
   #endif
   #ifdef X509_R_NEWER_CRL_NOT_NEWER
     {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
   #else
-    {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132},
+    {"NEWER_CRL_NOT_NEWER", 11, 132},
+  #endif
+  #ifdef X509_R_NO_CERTIFICATE_FOUND
+    {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND},
+  #else
+    {"NO_CERTIFICATE_FOUND", 11, 135},
+  #endif
+  #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND
+    {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND},
+  #else
+    {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136},
   #endif
   #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
     {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
   #else
-    {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105},
+    {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105},
+  #endif
+  #ifdef X509_R_NO_CRL_FOUND
+    {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND},
+  #else
+    {"NO_CRL_FOUND", 11, 137},
   #endif
   #ifdef X509_R_NO_CRL_NUMBER
     {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
   #else
-    {"NO_CRL_NUMBER", ERR_LIB_X509, 130},
+    {"NO_CRL_NUMBER", 11, 130},
   #endif
   #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
     {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
   #else
-    {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, 125},
+    {"PUBLIC_KEY_DECODE_ERROR", 11, 125},
   #endif
   #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
     {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR},
   #else
-    {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, 126},
+    {"PUBLIC_KEY_ENCODE_ERROR", 11, 126},
   #endif
   #ifdef X509_R_SHOULD_RETRY
     {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
   #else
-    {"SHOULD_RETRY", ERR_LIB_X509, 106},
+    {"SHOULD_RETRY", 11, 106},
   #endif
   #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
     {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
   #else
-    {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, 107},
+    {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107},
   #endif
   #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
     {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
   #else
-    {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, 108},
+    {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108},
   #endif
   #ifdef X509_R_UNKNOWN_KEY_TYPE
     {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
   #else
-    {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, 117},
+    {"UNKNOWN_KEY_TYPE", 11, 117},
   #endif
   #ifdef X509_R_UNKNOWN_NID
     {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
   #else
-    {"UNKNOWN_NID", ERR_LIB_X509, 109},
+    {"UNKNOWN_NID", 11, 109},
   #endif
   #ifdef X509_R_UNKNOWN_PURPOSE_ID
     {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
   #else
-    {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, 121},
+    {"UNKNOWN_PURPOSE_ID", 11, 121},
   #endif
   #ifdef X509_R_UNKNOWN_TRUST_ID
     {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
   #else
-    {"UNKNOWN_TRUST_ID", ERR_LIB_X509, 120},
+    {"UNKNOWN_TRUST_ID", 11, 120},
   #endif
   #ifdef X509_R_UNSUPPORTED_ALGORITHM
     {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
   #else
-    {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, 111},
+    {"UNSUPPORTED_ALGORITHM", 11, 111},
   #endif
   #ifdef X509_R_WRONG_LOOKUP_TYPE
     {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
   #else
-    {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, 112},
+    {"WRONG_LOOKUP_TYPE", 11, 112},
   #endif
   #ifdef X509_R_WRONG_TYPE
     {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
   #else
-    {"WRONG_TYPE", ERR_LIB_X509, 122},
+    {"WRONG_TYPE", 11, 122},
   #endif
     { NULL }
 };
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 9281c68..1c917b7 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -2365,6 +2365,9 @@
                        "unknown" float format */
                     if (ptr->format == 'd' || ptr->format == 'f')
                         break;
+                    /* Skip _Bool, semantics are different for standard size */
+                    if (ptr->format == '?')
+                        break;
                     ptr->pack = native->pack;
                     ptr->unpack = native->unpack;
                     break;
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index b540716..da3579c 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -5063,6 +5063,21 @@
 }
 
 
+static PyObject*
+pynumber_tobase(PyObject *module, PyObject *args)
+{
+    PyObject *obj;
+    int base;
+    if (!PyArg_ParseTuple(args, "Oi:pynumber_tobase",
+                          &obj, &base)) {
+        return NULL;
+    }
+    return PyNumber_ToBase(obj, base);
+}
+
+
+static PyObject *test_buildvalue_issue38913(PyObject *, PyObject *);
+
 static PyMethodDef TestMethods[] = {
     {"raise_exception",         raise_exception,                 METH_VARARGS},
     {"raise_memoryerror",       raise_memoryerror,               METH_NOARGS},
@@ -5122,6 +5137,7 @@
 #endif
     {"getbuffer_with_null_view", getbuffer_with_null_view, METH_O},
     {"test_buildvalue_N",       test_buildvalue_N,               METH_NOARGS},
+    {"test_buildvalue_issue38913", test_buildvalue_issue38913,   METH_NOARGS},
     {"get_args", get_args, METH_VARARGS},
     {"get_kwargs", (PyCFunction)(void(*)(void))get_kwargs, METH_VARARGS|METH_KEYWORDS},
     {"getargs_tuple",           getargs_tuple,                   METH_VARARGS},
@@ -5306,6 +5322,7 @@
     {"negative_refcount", negative_refcount, METH_NOARGS},
 #endif
     {"write_unraisable_exc", test_write_unraisable_exc, METH_VARARGS},
+    {"pynumber_tobase", pynumber_tobase, METH_VARARGS},
     {NULL, NULL} /* sentinel */
 };
 
@@ -6332,3 +6349,42 @@
     PyState_AddModule(m, &_testcapimodule);
     return m;
 }
+
+
+/* Test the C API exposed when PY_SSIZE_T_CLEAN is not defined */
+
+#undef Py_BuildValue
+PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
+
+static PyObject *
+test_buildvalue_issue38913(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+    PyObject *res;
+    const char str[] = "string";
+    const Py_UNICODE unicode[] = L"unicode";
+    PyErr_SetNone(PyExc_ZeroDivisionError);
+
+    res = Py_BuildValue("(s#O)", str, 1, Py_None);
+    assert(res == NULL);
+    if (!PyErr_ExceptionMatches(PyExc_ZeroDivisionError)) {
+        return NULL;
+    }
+    res = Py_BuildValue("(z#O)", str, 1, Py_None);
+    assert(res == NULL);
+    if (!PyErr_ExceptionMatches(PyExc_ZeroDivisionError)) {
+        return NULL;
+    }
+    res = Py_BuildValue("(y#O)", str, 1, Py_None);
+    assert(res == NULL);
+    if (!PyErr_ExceptionMatches(PyExc_ZeroDivisionError)) {
+        return NULL;
+    }
+    res = Py_BuildValue("(u#O)", unicode, 1, Py_None);
+    assert(res == NULL);
+    if (!PyErr_ExceptionMatches(PyExc_ZeroDivisionError)) {
+        return NULL;
+    }
+
+    PyErr_Clear();
+    Py_RETURN_NONE;
+}
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index c0d1d4d..09ecdb3 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -3900,7 +3900,7 @@
 
 #endif /* defined(HAVE_WAITPID) */
 
-#if defined(HAVE_CWAIT)
+#if !defined(HAVE_WAITPID) && defined(HAVE_CWAIT)
 
 PyDoc_STRVAR(os_waitpid__doc__,
 "waitpid($module, pid, options, /)\n"
@@ -3936,7 +3936,7 @@
     return return_value;
 }
 
-#endif /* defined(HAVE_CWAIT) */
+#endif /* !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) */
 
 #if defined(HAVE_WAIT)
 
@@ -8723,4 +8723,4 @@
 #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF
     #define OS__REMOVE_DLL_DIRECTORY_METHODDEF
 #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */
-/*[clinic end generated code: output=1ded1fbc8fd37b27 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=edb5a840b51fcaa8 input=a9049054013a1b77]*/
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 4e97337..b78fced 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1027,9 +1027,13 @@
     if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
         return NULL;
     x = PyFloat_AsDouble(args[0]);
-    y = PyFloat_AsDouble(args[1]);
-    if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
+    if (x == -1.0 && PyErr_Occurred()) {
         return NULL;
+    }
+    y = PyFloat_AsDouble(args[1]);
+    if (y == -1.0 && PyErr_Occurred()) {
+        return NULL;
+    }
     errno = 0;
     PyFPE_START_PROTECT("in math_2", return 0);
     r = (*func)(x, y);
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index affaf1d..f7712d9 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -242,7 +242,7 @@
      arg = dsp.xxx(arg)
 */
 static PyObject *
-_do_ioctl_1(int fd, PyObject *args, char *fname, int cmd)
+_do_ioctl_1(int fd, PyObject *args, char *fname, unsigned long cmd)
 {
     char argfmt[33] = "i:";
     int arg;
@@ -267,7 +267,7 @@
    way.
 */
 static PyObject *
-_do_ioctl_1_internal(int fd, PyObject *args, char *fname, int cmd)
+_do_ioctl_1_internal(int fd, PyObject *args, char *fname, unsigned long cmd)
 {
     char argfmt[32] = ":";
     int arg = 0;
@@ -287,7 +287,7 @@
 /* _do_ioctl_0() is a private helper for the no-argument ioctls:
    SNDCTL_DSP_{SYNC,RESET,POST}. */
 static PyObject *
-_do_ioctl_0(int fd, PyObject *args, char *fname, int cmd)
+_do_ioctl_0(int fd, PyObject *args, char *fname, unsigned long cmd)
 {
     char argfmt[32] = ":";
     int rv;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 80de5bc..06d6520 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6906,17 +6906,39 @@
         return NULL;
 #endif
 
+    while (1) {
 #ifdef __APPLE__
-    groups = PyMem_New(int, ngroups);
+        groups = PyMem_New(int, ngroups);
 #else
-    groups = PyMem_New(gid_t, ngroups);
+        groups = PyMem_New(gid_t, ngroups);
 #endif
-    if (groups == NULL)
-        return PyErr_NoMemory();
+        if (groups == NULL) {
+            return PyErr_NoMemory();
+        }
 
-    if (getgrouplist(user, basegid, groups, &ngroups) == -1) {
-        PyMem_Del(groups);
-        return posix_error();
+        int old_ngroups = ngroups;
+        if (getgrouplist(user, basegid, groups, &ngroups) != -1) {
+            /* Success */
+            break;
+        }
+
+        /* getgrouplist() fails if the group list is too small */
+        PyMem_Free(groups);
+
+        if (ngroups > old_ngroups) {
+            /* If the group list is too small, the glibc implementation of
+               getgrouplist() sets ngroups to the total number of groups and
+               returns -1. */
+        }
+        else {
+            /* Double the group list size */
+            if (ngroups > INT_MAX / 2) {
+                return PyErr_NoMemory();
+            }
+            ngroups *= 2;
+        }
+
+        /* Retry getgrouplist() with a larger group list */
     }
 
 #ifdef _Py_MEMORY_SANITIZER
@@ -7845,8 +7867,10 @@
     if (res < 0)
         return (!async_err) ? posix_error() : NULL;
 
+    unsigned long long ustatus = (unsigned int)status;
+
     /* shift the status left a byte so this is more like the POSIX waitpid */
-    return Py_BuildValue(_Py_PARSE_INTPTR "i", res, status << 8);
+    return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8);
 }
 #endif
 
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 594a0d6..5dc5f4e 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5069,7 +5069,7 @@
 
 #ifdef MS_WINDOWS
     /* In this case, we don't use the family, type and proto args */
-    if (fdobj != NULL && fdobj != Py_None)
+    if (fdobj == NULL || fdobj == Py_None)
 #endif
     {
         if (PySys_Audit("socket.__new__", "Oiii",
@@ -5091,8 +5091,9 @@
             }
             memcpy(&info, PyBytes_AS_STRING(fdobj), sizeof(info));
 
-            if (PySys_Audit("socket()", "iii", info.iAddressFamily,
-                            info.iSocketType, info.iProtocol) < 0) {
+            if (PySys_Audit("socket.__new__", "Oiii", s,
+                            info.iAddressFamily, info.iSocketType,
+                            info.iProtocol) < 0) {
                 return -1;
             }
 
diff --git a/Objects/abstract.c b/Objects/abstract.c
index bc1ebd9..4fabfd7 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1509,18 +1509,15 @@
 PyObject *
 PyNumber_ToBase(PyObject *n, int base)
 {
-    PyObject *res = NULL;
+    if (!(base == 2 || base == 8 || base == 10 || base == 16)) {
+        PyErr_SetString(PyExc_SystemError,
+                        "PyNumber_ToBase: base must be 2, 8, 10 or 16");
+        return NULL;
+    }
     PyObject *index = PyNumber_Index(n);
-
     if (!index)
         return NULL;
-    if (PyLong_Check(index))
-        res = _PyLong_Format(index, base);
-    else
-        /* It should not be possible to get here, as
-           PyNumber_Index already has a check for the same
-           condition */
-        PyErr_SetString(PyExc_ValueError, "PyNumber_ToBase: index not int");
+    PyObject *res = _PyLong_Format(index, base);
     Py_DECREF(index);
     return res;
 }
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 119be35..729f42c 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -892,7 +892,8 @@
             vectorcall = method_vectorcall_O;
             break;
         default:
-            PyErr_SetString(PyExc_SystemError, "bad call flags");
+            PyErr_Format(PyExc_SystemError,
+                         "%s() method: bad call flags", method->ml_name);
             return NULL;
     }
 
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 3494f11..3604a55 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -62,7 +62,8 @@
             vectorcall = cfunction_vectorcall_O;
             break;
         default:
-            PyErr_SetString(PyExc_SystemError, "bad call flags");
+            PyErr_Format(PyExc_SystemError,
+                         "%s() method: bad call flags", ml->ml_name);
             return NULL;
     }
 
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 4c9ae3b..ac0da9b 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1453,7 +1453,6 @@
     _ODictNode *node;
 
     Py_VISIT(od->od_inst_dict);
-    Py_VISIT(od->od_weakreflist);
     _odict_FOREACH(od, node) {
         Py_VISIT(_odictnode_KEY(node));
     }
@@ -1466,7 +1465,6 @@
 odict_tp_clear(PyODictObject *od)
 {
     Py_CLEAR(od->od_inst_dict);
-    Py_CLEAR(od->od_weakreflist);
     PyDict_Clear((PyObject *)od);
     _odict_clear_nodes(od);
     return 0;
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index fc2d274..bd58094 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -719,8 +719,10 @@
         return NULL;
     assert(PyTuple_Check(tmp));
     newobj = type->tp_alloc(type, n = PyTuple_GET_SIZE(tmp));
-    if (newobj == NULL)
+    if (newobj == NULL) {
+        Py_DECREF(tmp);
         return NULL;
+    }
     for (i = 0; i < n; i++) {
         item = PyTuple_GET_ITEM(tmp, i);
         Py_INCREF(item);
diff --git a/PC/icons/logo.svg b/PC/icons/logo.svg
new file mode 100644
index 0000000..6f52150
--- /dev/null
+++ b/PC/icons/logo.svg
@@ -0,0 +1 @@
+<svg width="238" height="237" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="hidden"><defs><clipPath id="clip0"><path d="M706-314 944-314 944-77 706-77Z" fill-rule="evenodd" clip-rule="evenodd"/></clipPath></defs><g clip-path="url(#clip0)" transform="translate(-706 314)"><path d="M792.441-295.763C786.496-295.763 781.697-290.979 781.697-285.062 781.697-279.166 786.496-274.382 792.441-274.382 798.365-274.382 803.184-279.166 803.184-285.062 803.184-290.979 798.365-295.763 792.441-295.763ZM823.472-312.998C833.277-313.043 843.484-312.329 853.336-310.724 868.899-308.185 882-296.728 882-281.516L882-228.072C882-212.398 869.282-199.557 853.336-199.557L796.03-199.557C776.58-199.557 760.189-183.169 760.189-164.641L760.189-139 740.485-139C723.817-139 714.114-150.877 710.037-167.494 704.538-189.82 704.772-203.124 710.037-224.505 714.602-243.159 729.189-253 745.857-253L767.365-253 824.693-253 824.693-260.134 767.365-260.134 767.365-281.516C767.365-297.715 771.76-306.527 796.03-310.724 804.268-312.151 813.668-312.953 823.472-312.998Z" fill="#366A96" fill-rule="evenodd"/><path d="M857.377-117.071C851.466-117.071 846.655-112.267 846.655-106.348 846.655-100.406 851.466-95.6026 857.377-95.6026 863.31-95.6026 868.099-100.406 868.099-106.348 868.099-112.267 863.31-117.071 857.377-117.071ZM889.563-253 911.007-253C927.662-253 935.502-240.696 939.614-224.39 945.334-201.743 945.589-184.804 939.614-167.148 933.828-150 927.642-138.539 911.007-138.539L882.402-138.539 825.211-138.539 825.211-131.375 882.402-131.375 882.402-109.908C882.402-93.6435 868.205-85.4055 853.796-81.2973 832.12-75.1034 814.722-76.0513 796.606-81.2973 781.476-85.6801 768-94.6332 768-109.908L768-163.568C768-179.01 780.947-192.199 796.606-192.199L853.796-192.199C872.846-192.199 889.563-208.568 889.563-227.971Z" fill="#FFC836" fill-rule="evenodd"/></g></svg>
\ No newline at end of file
diff --git a/PC/icons/logox128.png b/PC/icons/logox128.png
new file mode 100644
index 0000000..d2655c7
--- /dev/null
+++ b/PC/icons/logox128.png
Binary files differ
diff --git a/PC/layout/main.py b/PC/layout/main.py
index 305cb51..3eef755 100644
--- a/PC/layout/main.py
+++ b/PC/layout/main.py
@@ -173,8 +173,12 @@
     if ns.include_stable:
         yield from in_build(PYTHON_STABLE_DLL_NAME)
 
+    found_any = False
     for dest, src in rglob(ns.build, "vcruntime*.dll"):
+        found_any = True
         yield dest, src
+    if not found_any:
+        log_error("Failed to locate vcruntime DLL in the build.")
 
     yield "LICENSE.txt", ns.build / "LICENSE.txt"
 
diff --git a/PC/layout/support/nuspec.py b/PC/layout/support/nuspec.py
index b85095c..dbcb713 100644
--- a/PC/layout/support/nuspec.py
+++ b/PC/layout/support/nuspec.py
@@ -3,6 +3,7 @@
 """
 
 import os
+import sys
 
 from .constants import *
 
@@ -13,7 +14,8 @@
 NUSPEC_DATA = {
     "PYTHON_TAG": VER_DOT,
     "PYTHON_VERSION": os.getenv("PYTHON_NUSPEC_VERSION"),
-    "FILELIST": r'    <file src="**\*" target="tools" />',
+    "FILELIST": r'    <file src="**\*" exclude="python.png" target="tools" />',
+    "GIT": sys._git,
 }
 
 NUSPEC_PLATFORM_DATA = dict(
@@ -29,7 +31,7 @@
         VER_DOT, VER_MICRO, "-" if VER_SUFFIX else "", VER_SUFFIX
     )
 
-FILELIST_WITH_PROPS = r"""    <file src="**\*" exclude="python.props" target="tools" />
+FILELIST_WITH_PROPS = r"""    <file src="**\*" exclude="python.png;python.props" target="tools" />
     <file src="python.props" target="build\native" />"""
 
 NUSPEC_TEMPLATE = r"""<?xml version="1.0"?>
@@ -42,10 +44,13 @@
     <license type="file">tools\LICENSE.txt</license>
     <projectUrl>https://www.python.org/</projectUrl>
     <description>Installs {PYTHON_BITNESS} Python for use in build scenarios.</description>
+    <icon>images\python.png</icon>
     <iconUrl>https://www.python.org/static/favicon.ico</iconUrl>
     <tags>python</tags>
+    <repository type="git" url="https://github.com/Python/CPython.git" commit="{GIT[2]}" />
   </metadata>
   <files>
+    <file src="python.png" target="images" />
 {FILELIST}
   </files>
 </package>
@@ -70,3 +75,4 @@
             data["FILELIST"] = FILELIST_WITH_PROPS
         nuspec = NUSPEC_TEMPLATE.format_map(data)
         yield "python.nuspec", ("python.nuspec", nuspec.encode("utf-8"))
+        yield "python.png", ns.source / "PC" / "icons" / "logox128.png"
diff --git a/PC/layout/support/props.py b/PC/layout/support/props.py
index b1560b5..1eb9b7c 100644
--- a/PC/layout/support/props.py
+++ b/PC/layout/support/props.py
@@ -29,8 +29,7 @@
 PROPS_TEMPLATE = r"""<?xml version="1.0" encoding="utf-8"?>
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup Condition="$(Platform) == '{PYTHON_PLATFORM}'">
-    <PythonHome Condition="$(Configuration) == 'Debug'">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe")</PythonHome>
-    <PythonHome Condition="$(PythonHome) == ''">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe")</PythonHome>
+    <PythonHome Condition="$(PythonHome) == ''">$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools"))</PythonHome>
     <PythonInclude>$(PythonHome)\include</PythonInclude>
     <PythonLibs>$(PythonHome)\libs</PythonLibs>
     <PythonTag>{PYTHON_TAG}</PythonTag>
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index b40e24f..b6b8d44 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -470,6 +470,10 @@
    (which you can't on SCO ODT 3.0). */
 /* #undef SYS_SELECT_WITH_SYS_TIME */
 
+/* Define if you want build the _decimal module using a coroutine-local rather
+   than a thread-local context */
+#define WITH_DECIMAL_CONTEXTVAR 1
+
 /* Define if you want documentation strings in extension modules */
 #define WITH_DOC_STRINGS 1
 
diff --git a/PCbuild/find_msbuild.bat b/PCbuild/find_msbuild.bat
index bc9d00c..ce7e71e 100644
--- a/PCbuild/find_msbuild.bat
+++ b/PCbuild/find_msbuild.bat
@@ -32,20 +32,13 @@
 @rem VS 2017 and later provide vswhere.exe, which can be used
 @if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" goto :skip_vswhere
 @set _Py_MSBuild_Root=
-@for /F "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -prerelease') DO @(set _Py_MSBuild_Root=%%i\MSBuild)
+@for /F "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO @(set _Py_MSBuild_Root=%%i\MSBuild)
 @if not defined _Py_MSBuild_Root goto :skip_vswhere
 @for %%j in (Current 15.0) DO @if exist "%_Py_MSBuild_Root%\%%j\Bin\msbuild.exe" (set MSBUILD="%_Py_MSBuild_Root%\%%j\Bin\msbuild.exe")
 @set _Py_MSBuild_Root=
 @if defined MSBUILD @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio installation) & goto :found
 :skip_vswhere
 
-@rem VS 2017 sets exactly one install as the "main" install, so we may find MSBuild in there.
-@reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v 15.0 /reg:32 >nul 2>nul
-@if NOT ERRORLEVEL 1 @for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v 15.0 /reg:32') DO @(
-    @if "%%i"=="15.0" @if exist "%%k\MSBuild\15.0\Bin\msbuild.exe" @(set MSBUILD="%%k\MSBuild\15.0\Bin\msbuild.exe")
-)
-@if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio 2017 registry) & goto :found
-
 @rem VS 2015 and earlier register MSBuild separately, so we can find it.
 @reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32 >nul 2>nul
 @if NOT ERRORLEVEL 1 @for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32') DO @(
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index 100149e..dca0b45 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -53,8 +53,8 @@
 set libraries=
 set libraries=%libraries%                                       bzip2-1.0.6
 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries%  libffi-3.3.0-rc0-r1
-if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries%     openssl-1.1.1d
-set libraries=%libraries%                                       sqlite-3.28.0.0
+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries%     openssl-1.1.1f
+set libraries=%libraries%                                       sqlite-3.31.1.0
 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0
 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0
 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tix-8.4.3.6
@@ -77,7 +77,7 @@
 
 set binaries=
 if NOT "%IncludeLibffi%"=="false"  set binaries=%binaries% libffi
-if NOT "%IncludeSSL%"=="false"     set binaries=%binaries% openssl-bin-1.1.1d
+if NOT "%IncludeSSL%"=="false"     set binaries=%binaries% openssl-bin-1.1.1f
 if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0
 if NOT "%IncludeSSLSrc%"=="false"  set binaries=%binaries% nasm-2.11.06
 
diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj
index 7ed71bd..6e9d545 100644
--- a/PCbuild/lib.pyproj
+++ b/PCbuild/lib.pyproj
@@ -1589,6 +1589,7 @@
     <Content Include="idlelib\Icons\idle_32.png" />
     <Content Include="idlelib\Icons\idle_48.gif" />
     <Content Include="idlelib\Icons\idle_48.png" />
+    <Content Include="idlelib\Icons\idle_256.png" />
     <Content Include="idlelib\Icons\minusnode.gif" />
     <Content Include="idlelib\Icons\openfolder.gif" />
     <Content Include="idlelib\Icons\plusnode.gif" />
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 7c0f50b..59f2df4 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -200,4 +200,43 @@
     <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
     <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />
   </Target>
+
+
+  <Target Name="FindVCRedistDir">
+    <!-- Hard coded path for VS 2015 -->
+    <PropertyGroup Condition="$(PlatformToolset) == 'v140'">
+      <VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir>
+    </PropertyGroup>
+
+    <!-- Search for version number in some broken Build Tools installs -->
+    <ItemGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''">
+      <_RedistFiles Include="$(VCInstallDir)\Redist\MSVC\*\*.*" />
+    </ItemGroup>
+    <PropertyGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''">
+      <_RedistDir>%(_RedistFiles.Directory)</_RedistDir>
+      <VCToolsRedistVersion>$([System.IO.Path]::GetFileName($(_RedistDir.Trim(`\`))))</VCToolsRedistVersion>
+    </PropertyGroup>
+
+    <!-- Use correct path for VS 2017 and later -->
+    <PropertyGroup Condition="$(VCRedistDir) == ''">
+      <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir>
+    </PropertyGroup>
+
+    <PropertyGroup>
+      <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir>
+      <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir>
+    </PropertyGroup>
+
+    <Message Text="VC Redist Directory: $(VCRedistDir)" />
+    <Message Text="VC Redist Version: $(VCToolsRedistVersion)" />
+  </Target>
+
+  <Target Name="FindVCRuntime" Returns="VCRuntimeDLL" DependsOnTargets="FindVCRedistDir">
+    <ItemGroup Condition="$(VCInstallDir) != ''">
+      <VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" />
+    </ItemGroup>
+
+    <Warning Text="vcruntime*.dll not found under $(VCRedistDir)." Condition="@(VCRuntimeDLL) == ''" />
+    <Message Text="VC Runtime DLL(s):%0A- @(VCRuntimeDLL,'%0A- ')" />
+  </Target>
 </Project>
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 8583138..d1d16d6 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -56,14 +56,14 @@
     <ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir>
     <ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
     <ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir>
-    <sqlite3Dir>$(ExternalsDir)sqlite-3.28.0.0\</sqlite3Dir>
+    <sqlite3Dir>$(ExternalsDir)sqlite-3.31.1.0\</sqlite3Dir>
     <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
     <lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
     <libffiDir>$(ExternalsDir)libffi\</libffiDir>
     <libffiOutDir>$(ExternalsDir)libffi\$(ArchName)\</libffiOutDir>
     <libffiIncludeDir>$(libffiOutDir)include</libffiIncludeDir>
-    <opensslDir>$(ExternalsDir)openssl-1.1.1d\</opensslDir>
-    <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1d\$(ArchName)\</opensslOutDir>
+    <opensslDir>$(ExternalsDir)openssl-1.1.1f\</opensslDir>
+    <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1f\$(ArchName)\</opensslOutDir>
     <opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir>
     <nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir>
     <zlibDir>$(ExternalsDir)\zlib-1.2.11\</zlibDir>
diff --git a/PCbuild/python_uwp.vcxproj b/PCbuild/python_uwp.vcxproj
index 5ff120a..fb27e9e 100644
--- a/PCbuild/python_uwp.vcxproj
+++ b/PCbuild/python_uwp.vcxproj
@@ -95,6 +95,7 @@
     <Link>
       <AdditionalDependencies>windowsapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SubSystem>Console</SubSystem>
+      <StackReserveSize>2000000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="$(Configuration) != 'Debug'">
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 13c3b59..0666b90 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -519,15 +519,9 @@
     <Warning Text="Not including zlib is not a supported configuration." />
   </Target>
 
-  <PropertyGroup>
-    <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir>
-    <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir>
-    <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir>
-  </PropertyGroup>
-  <ItemGroup Condition="$(VCInstallDir) != ''">
-    <VCRuntimeDLL Include="$(VCRedistDir)\**\vcruntime*.dll" />
-  </ItemGroup>
-  <Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)">
+  <Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)" DependsOnTargets="FindVCRuntime">
+    <!-- bpo-38597: When we switch to another VCRuntime DLL, include vcruntime140.dll as well -->
+    <Warning Text="A copy of vcruntime140.dll is also required" Condition="!$(VCToolsRedistVersion.StartsWith(`14.`))" />
     <Copy SourceFiles="%(VCRuntimeDLL.FullPath)" DestinationFolder="$(OutDir)" />
   </Target>
   <Target Name="_CleanVCRuntime" AfterTargets="Clean">
diff --git a/PCbuild/pythonw_uwp.vcxproj b/PCbuild/pythonw_uwp.vcxproj
index 828d0d1..e21e46a 100644
--- a/PCbuild/pythonw_uwp.vcxproj
+++ b/PCbuild/pythonw_uwp.vcxproj
@@ -95,6 +95,7 @@
     <Link>
       <AdditionalDependencies>windowsapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SubSystem>Windows</SubSystem>
+      <StackReserveSize>2000000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="$(Configuration) != 'Debug'">
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index 80e3359..ceed5dc 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -184,7 +184,7 @@
     again when building.
 
 _sqlite3
-    Wraps SQLite 3.28.0.0, which is itself built by sqlite3.vcxproj
+    Wraps SQLite 3.31.1.0, which is itself built by sqlite3.vcxproj
     Homepage:
         http://www.sqlite.org/
 _tkinter
diff --git a/Python/_warnings.c b/Python/_warnings.c
index e02d283..52a13df 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -856,11 +856,11 @@
         int rc;
 
         if (PyErr_Occurred()) {
-            return 0;
+            goto handle_error;
         }
         *registry = PyDict_New();
         if (*registry == NULL)
-            return 0;
+            goto handle_error;
 
          rc = _PyDict_SetItemId(globals, &PyId___warningregistry__, *registry);
          if (rc < 0)
@@ -886,10 +886,9 @@
     return 1;
 
  handle_error:
-    /* filename not XDECREF'ed here as there is no way to jump here with a
-       dangling reference. */
     Py_XDECREF(*registry);
     Py_XDECREF(*module);
+    Py_DECREF(*filename);
     return 0;
 }
 
diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c
index f376e86..1a7cd23 100644
--- a/Python/ast_unparse.c
+++ b/Python/ast_unparse.c
@@ -746,6 +746,7 @@
         APPEND_STR_IF(i > 0, ", ");
         APPEND(slice, (slice_ty)asdl_seq_GET(slice->v.ExtSlice.dims, i));
     }
+    APPEND_STR_IF(dims_count == 1, ",");
     return 0;
 }
 
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 33f9690..fe22bbd 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -738,7 +738,7 @@
     }
 
     if (flags &
-        ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_DONT_IMPLY_DEDENT | PyCF_ONLY_AST | PyCF_TYPE_COMMENTS))
+        ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_COMPILE_MASK))
     {
         PyErr_SetString(PyExc_ValueError,
                         "compile(): unrecognised flags");
diff --git a/Python/ceval.c b/Python/ceval.c
index 3306fb9..1873e37 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1159,7 +1159,7 @@
         co->co_opcache_flag++;
         if (co->co_opcache_flag == OPCACHE_MIN_RUNS) {
             if (_PyCode_InitOpcache(co) < 0) {
-                return NULL;
+                goto exit_eval_frame;
             }
 #if OPCACHE_STATS
             opcache_code_objects_extra_mem +=
@@ -4686,6 +4686,7 @@
 PyEval_SetProfile(Py_tracefunc func, PyObject *arg)
 {
     if (PySys_Audit("sys.setprofile", NULL) < 0) {
+        _PyErr_WriteUnraisableMsg("in PyEval_SetProfile", NULL);
         return;
     }
 
@@ -4707,6 +4708,7 @@
 PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
 {
     if (PySys_Audit("sys.settrace", NULL) < 0) {
+        _PyErr_WriteUnraisableMsg("in PyEval_SetTrace", NULL);
         return;
     }
 
@@ -4742,19 +4744,6 @@
     return tstate->coroutine_origin_tracking_depth;
 }
 
-void
-_PyEval_SetAsyncGenFirstiter(PyObject *firstiter)
-{
-    PyThreadState *tstate = _PyThreadState_GET();
-
-    if (PySys_Audit("sys.set_asyncgen_hook_firstiter", NULL) < 0) {
-        return;
-    }
-
-    Py_XINCREF(firstiter);
-    Py_XSETREF(tstate->async_gen_firstiter, firstiter);
-}
-
 PyObject *
 _PyEval_GetAsyncGenFirstiter(void)
 {
@@ -4762,19 +4751,6 @@
     return tstate->async_gen_firstiter;
 }
 
-void
-_PyEval_SetAsyncGenFinalizer(PyObject *finalizer)
-{
-    PyThreadState *tstate = _PyThreadState_GET();
-
-    if (PySys_Audit("sys.set_asyncgen_hook_finalizer", NULL) < 0) {
-        return;
-    }
-
-    Py_XINCREF(finalizer);
-    Py_XSETREF(tstate->async_gen_finalizer, finalizer);
-}
-
 PyObject *
 _PyEval_GetAsyncGenFinalizer(void)
 {
diff --git a/Python/compile.c b/Python/compile.c
index 11974c3..913ec99 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -41,6 +41,10 @@
 #define COMP_SETCOMP  2
 #define COMP_DICTCOMP 3
 
+#define IS_TOP_LEVEL_AWAIT(c) ( \
+        (c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) \
+        && (c->u->u_ste->ste_type == ModuleBlock))
+
 struct instr {
     unsigned i_jabs : 1;
     unsigned i_jrel : 1;
@@ -2682,7 +2686,7 @@
 compiler_async_for(struct compiler *c, stmt_ty s)
 {
     basicblock *start, *except, *end;
-    if (c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT){
+    if (IS_TOP_LEVEL_AWAIT(c)){
         c->u->u_ste->ste_coroutine = 1;
     } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION) {
         return compiler_error(c, "'async for' outside async function");
@@ -4465,11 +4469,14 @@
     PyCodeObject *co = NULL;
     comprehension_ty outermost;
     PyObject *qualname = NULL;
-    int is_async_function = c->u->u_ste->ste_coroutine;
     int is_async_generator = 0;
 
-    outermost = (comprehension_ty) asdl_seq_GET(generators, 0);
+    if (IS_TOP_LEVEL_AWAIT(c)) {
+        c->u->u_ste->ste_coroutine = 1;
+    }
+    int is_async_function = c->u->u_ste->ste_coroutine;
 
+    outermost = (comprehension_ty) asdl_seq_GET(generators, 0);
     if (!compiler_enter_scope(c, name, COMPILER_SCOPE_COMPREHENSION,
                               (void *)e, e->lineno))
     {
@@ -4666,7 +4673,7 @@
     withitem_ty item = asdl_seq_GET(s->v.AsyncWith.items, pos);
 
     assert(s->kind == AsyncWith_kind);
-    if (c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT){
+    if (IS_TOP_LEVEL_AWAIT(c)){
         c->u->u_ste->ste_coroutine = 1;
     } else if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION){
         return compiler_error(c, "'async with' outside async function");
@@ -4877,7 +4884,7 @@
         ADDOP(c, YIELD_FROM);
         break;
     case Await_kind:
-        if (!(c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT)){
+        if (!IS_TOP_LEVEL_AWAIT(c)){
             if (c->u->u_ste->ste_type != FunctionBlock){
                 return compiler_error(c, "'await' outside function");
             }
@@ -5820,7 +5827,7 @@
     /* (Only) inherit compilerflags in PyCF_MASK */
     flags |= (c->c_flags->cf_flags & PyCF_MASK);
 
-    if ((c->c_flags->cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) &&
+    if ((IS_TOP_LEVEL_AWAIT(c)) &&
          ste->ste_coroutine &&
          !ste->ste_generator) {
         flags |= CO_COROUTINE;
diff --git a/Python/getopt.c b/Python/getopt.c
index 1a7db3f..249ad1e 100644
--- a/Python/getopt.c
+++ b/Python/getopt.c
@@ -105,7 +105,9 @@
     if (option == L'-') {
         // Parse long option.
         if (*opt_ptr == L'\0') {
-            fprintf(stderr, "expected long option\n");
+            if (_PyOS_opterr) {
+                fprintf(stderr, "expected long option\n");
+            }
             return -1;
         }
         *longindex = 0;
@@ -115,7 +117,9 @@
                 break;
         }
         if (!opt->name) {
-            fprintf(stderr, "unknown option %ls\n", argv[_PyOS_optind - 1]);
+            if (_PyOS_opterr) {
+                fprintf(stderr, "unknown option %ls\n", argv[_PyOS_optind - 1]);
+            }
             return '_';
         }
         opt_ptr = L"";
@@ -123,8 +127,10 @@
             return opt->val;
         }
         if (_PyOS_optind >= argc) {
-            fprintf(stderr, "Argument expected for the %ls options\n",
-                    argv[_PyOS_optind - 1]);
+            if (_PyOS_opterr) {
+                fprintf(stderr, "Argument expected for the %ls options\n",
+                        argv[_PyOS_optind - 1]);
+            }
             return '_';
         }
         _PyOS_optarg = argv[_PyOS_optind++];
@@ -132,14 +138,16 @@
     }
 
     if (option == 'J') {
-        if (_PyOS_opterr)
+        if (_PyOS_opterr) {
             fprintf(stderr, "-J is reserved for Jython\n");
+        }
         return '_';
     }
 
     if ((ptr = wcschr(SHORT_OPTS, option)) == NULL) {
-        if (_PyOS_opterr)
+        if (_PyOS_opterr) {
             fprintf(stderr, "Unknown option: -%c\n", (char)option);
+        }
         return '_';
     }
 
@@ -151,9 +159,10 @@
 
         else {
             if (_PyOS_optind >= argc) {
-                if (_PyOS_opterr)
+                if (_PyOS_opterr) {
                     fprintf(stderr,
                         "Argument expected for the -%c option\n", (char)option);
+                }
                 return '_';
             }
 
diff --git a/Python/import.c b/Python/import.c
index 495012d..b73fe2f 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -300,6 +300,7 @@
 
     /* Free memory allocated by PyImport_ExtendInittab() */
     PyMem_RawFree(inittab_copy);
+    inittab_copy = NULL;
 
     PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
 }
@@ -1907,23 +1908,23 @@
 PyObject *
 PyImport_ReloadModule(PyObject *m)
 {
-    _Py_IDENTIFIER(imp);
+    _Py_IDENTIFIER(importlib);
     _Py_IDENTIFIER(reload);
     PyObject *reloaded_module = NULL;
-    PyObject *imp = _PyImport_GetModuleId(&PyId_imp);
-    if (imp == NULL) {
+    PyObject *importlib = _PyImport_GetModuleId(&PyId_importlib);
+    if (importlib == NULL) {
         if (PyErr_Occurred()) {
             return NULL;
         }
 
-        imp = PyImport_ImportModule("imp");
-        if (imp == NULL) {
+        importlib = PyImport_ImportModule("importlib");
+        if (importlib == NULL) {
             return NULL;
         }
     }
 
-    reloaded_module = _PyObject_CallMethodIdObjArgs(imp, &PyId_reload, m, NULL);
-    Py_DECREF(imp);
+    reloaded_module = _PyObject_CallMethodIdObjArgs(importlib, &PyId_reload, m, NULL);
+    Py_DECREF(importlib);
     return reloaded_module;
 }
 
diff --git a/Python/initconfig.c b/Python/initconfig.c
index a0b2691..a930b5d 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -1144,6 +1144,17 @@
             if (_PyStatus_EXCEPTION(status)) {
                 return status;
             }
+
+            /*
+             * This environment variable is used to communicate between
+             * the stub launcher and the real interpreter and isn't needed
+             * beyond this point.
+             *
+             * Clean up to avoid problems when launching other programs
+             * later on.
+             */
+            (void)unsetenv("__PYVENV_LAUNCHER__");
+
             return _PyStatus_OK();
         }
     }
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 6255822..7271af3 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -343,11 +343,11 @@
                 if (flags & FLAG_SIZE_T)
                     n = va_arg(*p_va, Py_ssize_t);
                 else {
+                    n = va_arg(*p_va, int);
                     if (PyErr_WarnEx(PyExc_DeprecationWarning,
                                 "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
                         return NULL;
                     }
-                    n = va_arg(*p_va, int);
                 }
             }
             else
@@ -396,11 +396,11 @@
                 if (flags & FLAG_SIZE_T)
                     n = va_arg(*p_va, Py_ssize_t);
                 else {
+                    n = va_arg(*p_va, int);
                     if (PyErr_WarnEx(PyExc_DeprecationWarning,
                                 "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
                         return NULL;
                     }
-                    n = va_arg(*p_va, int);
                 }
             }
             else
@@ -434,11 +434,11 @@
                 if (flags & FLAG_SIZE_T)
                     n = va_arg(*p_va, Py_ssize_t);
                 else {
+                    n = va_arg(*p_va, int);
                     if (PyErr_WarnEx(PyExc_DeprecationWarning,
                                 "PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
                         return NULL;
                     }
-                    n = va_arg(*p_va, int);
                 }
             }
             else
diff --git a/Python/pyhash.c b/Python/pyhash.c
index ba224ee..c0355ae 100644
--- a/Python/pyhash.c
+++ b/Python/pyhash.c
@@ -412,13 +412,6 @@
     return t;
 }
 
-static Py_hash_t
-pysiphash(const void *src, Py_ssize_t src_sz) {
-    return (Py_hash_t)siphash24(
-        _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1),
-        src, src_sz);
-}
-
 uint64_t
 _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz)
 {
@@ -427,6 +420,13 @@
 
 
 #if Py_HASH_ALGORITHM == Py_HASH_SIPHASH24
+static Py_hash_t
+pysiphash(const void *src, Py_ssize_t src_sz) {
+    return (Py_hash_t)siphash24(
+        _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1),
+        src, src_sz);
+}
+
 static PyHash_FuncDef PyHash_Func = {pysiphash, "siphash24", 64, 128};
 #endif
 
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index feb9285..27cebf3 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -2311,7 +2311,7 @@
 #ifdef SIGXFSZ
     PyOS_setsig(SIGXFSZ, SIG_IGN);
 #endif
-    PyOS_InitInterrupts(); /* May imply initsignal() */
+    PyOS_InitInterrupts(); /* May imply init_signals() */
     if (PyErr_Occurred()) {
         return _PyStatus_ERR("can't import signal");
     }
diff --git a/Python/pystate.c b/Python/pystate.c
index aba673c..3e10855 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -606,13 +606,12 @@
     tstate->context = NULL;
     tstate->context_ver = 1;
 
-    tstate->id = ++interp->tstate_next_unique_id;
-
     if (init) {
         _PyThreadState_Init(runtime, tstate);
     }
 
     HEAD_LOCK(runtime);
+    tstate->id = ++interp->tstate_next_unique_id;
     tstate->prev = NULL;
     tstate->next = interp->tstate_head;
     if (tstate->next)
@@ -763,11 +762,19 @@
 {
     int verbose = tstate->interp->config.verbose;
 
-    if (verbose && tstate->frame != NULL)
+    if (verbose && tstate->frame != NULL) {
+        /* bpo-20526: After the main thread calls
+           _PyRuntimeState_SetFinalizing() in Py_FinalizeEx(), threads must
+           exit when trying to take the GIL. If a thread exit in the middle of
+           _PyEval_EvalFrameDefault(), tstate->frame is not reset to its
+           previous value. It is more likely with daemon threads, but it can
+           happen with regular threads if threading._shutdown() fails
+           (ex: interrupted by CTRL+C). */
         fprintf(stderr,
           "PyThreadState_Clear: warning: thread still has a frame\n");
+    }
 
-    Py_CLEAR(tstate->frame);
+    /* Don't clear tstate->frame: it is a borrowed reference */
 
     Py_CLEAR(tstate->dict);
     Py_CLEAR(tstate->async_exc);
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index da4b6e1..b544f2b 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1178,6 +1178,51 @@
     2
 };
 
+static int
+set_async_gen_firstiter(PyObject *firstiter)
+{
+    PyThreadState *tstate = _PyThreadState_GET();
+
+    if (PySys_Audit("sys.set_asyncgen_hook_firstiter", NULL) < 0) {
+        return -1;
+    }
+
+    Py_XINCREF(firstiter);
+    Py_XSETREF(tstate->async_gen_firstiter, firstiter);
+    return 0;
+}
+
+void
+_PyEval_SetAsyncGenFirstiter(PyObject *firstiter)
+{
+    if (set_async_gen_firstiter(firstiter) < 0) {
+        PyErr_WriteUnraisable(NULL);
+    }
+}
+
+static int
+set_async_gen_finalizer(PyObject *finalizer)
+{
+    PyThreadState *tstate = _PyThreadState_GET();
+
+    if (PySys_Audit("sys.set_asyncgen_hook_finalizer", NULL) < 0) {
+        return -1;
+    }
+
+    Py_XINCREF(finalizer);
+    Py_XSETREF(tstate->async_gen_finalizer, finalizer);
+    return 0;
+}
+
+void
+_PyEval_SetAsyncGenFinalizer(PyObject *finalizer)
+{
+    if (set_async_gen_finalizer(finalizer) < 0) {
+        PyErr_WriteUnraisable(NULL);
+    }
+}
+
+
 static PyObject *
 sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw)
 {
@@ -1198,10 +1243,12 @@
                          Py_TYPE(finalizer)->tp_name);
             return NULL;
         }
-        _PyEval_SetAsyncGenFinalizer(finalizer);
+        if (set_async_gen_finalizer(finalizer) < 0) {
+            return NULL;
+        }
     }
-    else if (finalizer == Py_None) {
-        _PyEval_SetAsyncGenFinalizer(NULL);
+    else if (finalizer == Py_None && set_async_gen_finalizer(NULL) < 0) {
+        return NULL;
     }
 
     if (firstiter && firstiter != Py_None) {
@@ -1211,10 +1258,12 @@
                          Py_TYPE(firstiter)->tp_name);
             return NULL;
         }
-        _PyEval_SetAsyncGenFirstiter(firstiter);
+        if (set_async_gen_firstiter(firstiter) < 0) {
+            return NULL;
+        }
     }
-    else if (firstiter == Py_None) {
-        _PyEval_SetAsyncGenFirstiter(NULL);
+    else if (firstiter == Py_None && set_async_gen_firstiter(NULL) < 0) {
+        return NULL;
     }
 
     Py_RETURN_NONE;
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index a5246dd..23d585c 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -75,16 +75,16 @@
         }
     } else if (milliseconds != 0) {
         /* wait at least until the target */
-        DWORD now, target = GetTickCount() + milliseconds;
+        ULONGLONG now, target = GetTickCount64() + milliseconds;
         while (mutex->locked) {
             if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, (long long)milliseconds*1000) < 0) {
                 result = WAIT_FAILED;
                 break;
             }
-            now = GetTickCount();
+            now = GetTickCount64();
             if (target <= now)
                 break;
-            milliseconds = target-now;
+            milliseconds = (DWORD)(target-now);
         }
     }
     if (!mutex->locked) {
diff --git a/README.rst b/README.rst
index cf74d1d..ae71b67 100644
--- a/README.rst
+++ b/README.rst
@@ -1,4 +1,4 @@
-This is Python version 3.8.2
+This is Python version 3.8.3
 ============================
 
 .. image:: https://travis-ci.org/python/cpython.svg?branch=3.8
diff --git a/Tools/clinic/cpp.py b/Tools/clinic/cpp.py
index e099590..77f5f96 100644
--- a/Tools/clinic/cpp.py
+++ b/Tools/clinic/cpp.py
@@ -141,23 +141,15 @@
         token = fields[0].lower()
         condition = ' '.join(fields[1:]).strip()
 
-        if_tokens = {'if', 'ifdef', 'ifndef'}
-        all_tokens = if_tokens | {'elif', 'else', 'endif'}
-
-        if token not in all_tokens:
-            return
-
-        # cheat a little here, to reuse the implementation of if
-        if token == 'elif':
-            pop_stack()
-            token = 'if'
-
-        if token in if_tokens:
+        if token in {'if', 'ifdef', 'ifndef', 'elif'}:
             if not condition:
                 self.fail("Invalid format for #" + token + " line: no argument!")
-            if token == 'if':
+            if token in {'if', 'elif'}:
                 if not self.is_a_simple_defined(condition):
                     condition = "(" + condition + ")"
+                if token == 'elif':
+                    previous_token, previous_condition = pop_stack()
+                    self.stack.append((previous_token, negate(previous_condition)))
             else:
                 fields = condition.split()
                 if len(fields) != 1:
@@ -166,18 +158,21 @@
                 condition = 'defined(' + symbol + ')'
                 if token == 'ifndef':
                     condition = '!' + condition
+                token = 'if'
 
-            self.stack.append(("if", condition))
-            if self.verbose:
-                print(self.status())
+            self.stack.append((token, condition))
+
+        elif token == 'else':
+            previous_token, previous_condition = pop_stack()
+            self.stack.append((previous_token, negate(previous_condition)))
+
+        elif token == 'endif':
+            while pop_stack()[0] != 'if':
+                pass
+
+        else:
             return
 
-        previous_token, previous_condition = pop_stack()
-
-        if token == 'else':
-            self.stack.append(('else', negate(previous_condition)))
-        elif token == 'endif':
-            pass
         if self.verbose:
             print(self.status())
 
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 93f997c..ffb1813 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -99,6 +99,8 @@
 
 ENCODING = locale.getpreferredencoding()
 
+FRAME_INFO_OPTIMIZED_OUT = '(frame information optimized out)'
+UNABLE_READ_INFO_PYTHON_FRAME = 'Unable to read information on python frame'
 EVALFRAME = '_PyEval_EvalFrameDefault'
 
 class NullPyObjectPtr(RuntimeError):
@@ -918,7 +920,7 @@
     def filename(self):
         '''Get the path of the current Python source file, as a string'''
         if self.is_optimized_out():
-            return '(frame information optimized out)'
+            return FRAME_INFO_OPTIMIZED_OUT
         return self.co_filename.proxyval(set())
 
     def current_line_num(self):
@@ -949,7 +951,7 @@
         '''Get the text of the current source line as a string, with a trailing
         newline character'''
         if self.is_optimized_out():
-            return '(frame information optimized out)'
+            return FRAME_INFO_OPTIMIZED_OUT
 
         lineno = self.current_line_num()
         if lineno is None:
@@ -970,7 +972,7 @@
 
     def write_repr(self, out, visited):
         if self.is_optimized_out():
-            out.write('(frame information optimized out)')
+            out.write(FRAME_INFO_OPTIMIZED_OUT)
             return
         lineno = self.current_line_num()
         lineno = str(lineno) if lineno is not None else "?"
@@ -993,7 +995,7 @@
 
     def print_traceback(self):
         if self.is_optimized_out():
-            sys.stdout.write('  (frame information optimized out)\n')
+            sys.stdout.write('  %s\n' % FRAME_INFO_OPTIMIZED_OUT)
             return
         visited = set()
         lineno = self.current_line_num()
@@ -1600,7 +1602,7 @@
         # This assumes the _POSIX_THREADS version of Python/ceval_gil.h:
         name = self._gdbframe.name()
         if name:
-            return 'pthread_cond_timedwait' in name
+            return (name == 'take_gil')
 
     def is_gc_collect(self):
         '''Is this frame "collect" within the garbage-collector?'''
@@ -1744,7 +1746,7 @@
 
         pyop = frame.get_pyop()
         if not pyop or pyop.is_optimized_out():
-            print('Unable to read information on python frame')
+            print(UNABLE_READ_INFO_PYTHON_FRAME)
             return
 
         filename = pyop.filename()
@@ -1904,7 +1906,7 @@
 
         pyop_frame = frame.get_pyop()
         if not pyop_frame:
-            print('Unable to read information on python frame')
+            print(UNABLE_READ_INFO_PYTHON_FRAME)
             return
 
         pyop_var, scope = pyop_frame.get_var_by_name(name)
@@ -1938,7 +1940,7 @@
 
         pyop_frame = frame.get_pyop()
         if not pyop_frame:
-            print('Unable to read information on python frame')
+            print(UNABLE_READ_INFO_PYTHON_FRAME)
             return
 
         for pyop_name, pyop_value in pyop_frame.iter_locals():
diff --git a/Tools/msi/exe/exe.wixproj b/Tools/msi/exe/exe.wixproj
index 326766b..be44f44 100644
--- a/Tools/msi/exe/exe.wixproj
+++ b/Tools/msi/exe/exe.wixproj
@@ -11,6 +11,9 @@
         <SuppressICEs>ICE43</SuppressICEs>
     </PropertyGroup>
     <Import Project="..\msi.props" />
+    <PropertyGroup Condition="exists('$(BuildPath)vcruntime140_1.dll')">
+        <DefineConstants>$(DefineConstants);Include_Vcruntime140_1_dll=1</DefineConstants>
+    </PropertyGroup>
     <ItemGroup>
         <Compile Include="exe.wxs" />
         <Compile Include="exe_files.wxs" />
diff --git a/Tools/msi/exe/exe_files.wxs b/Tools/msi/exe/exe_files.wxs
index 483d06c..15bf6a0 100644
--- a/Tools/msi/exe/exe_files.wxs
+++ b/Tools/msi/exe/exe_files.wxs
@@ -30,8 +30,13 @@
                 </RegistryKey>
             </Component>
             <Component Id="vcruntime140.dll" Directory="InstallDirectory" Guid="*">
-                <File Name="vcruntime140.dll" Source="!(bindpath.redist)vcruntime140.dll" KeyPath="yes" />
+                <File Name="vcruntime140.dll" Source="vcruntime140.dll" KeyPath="yes" />
             </Component>
+<?ifdef Include_Vcruntime140_1_dll ?>
+            <Component Id="vcruntime140_1.dll" Directory="InstallDirectory" Guid="*">
+                <File Name="vcruntime140_1.dll" Source="vcruntime140_1.dll" KeyPath="yes" />
+            </Component>
+<?endif ?>
         </ComponentGroup>
     </Fragment>
 
diff --git a/Tools/nuget/make_pkg.proj b/Tools/nuget/make_pkg.proj
index b387b8e..710ef3d 100644
--- a/Tools/nuget/make_pkg.proj
+++ b/Tools/nuget/make_pkg.proj
@@ -33,7 +33,7 @@
         
         <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)pkg\pip.exe" -B -m pip install -U $(Packages)</PackageArguments>
         
-        <NugetPackCommand>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec" -BasePath "$(IntermediateOutputPath)pkg"</NugetPackCommand>
+        <NugetPackCommand>"$(Nuget)" pack "$(IntermediateOutputPath)pkg\python.nuspec" -BasePath "$(IntermediateOutputPath)pkg"</NugetPackCommand>
         <NugetPackSymbolsCommand Condition="Exists('$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec')">"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec" -BasePath "$(BuildPath.TrimEnd(`\`))"</NugetPackSymbolsCommand>
         <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
         <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index a5cc000..0642b84 100644
--- a/Tools/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -556,7 +556,17 @@
     def _Subscript(self, t):
         self.dispatch(t.value)
         self.write("[")
-        self.dispatch(t.slice)
+        if (isinstance(t.slice, ast.Index)
+                and isinstance(t.slice.value, ast.Tuple)
+                and t.slice.value.elts):
+            if len(t.slice.value.elts) == 1:
+                elt = t.slice.value.elts[0]
+                self.dispatch(elt)
+                self.write(",")
+            else:
+                interleave(lambda: self.write(", "), self.dispatch, t.slice.value.elts)
+        else:
+            self.dispatch(t.slice)
         self.write("]")
 
     def _Starred(self, t):
@@ -581,7 +591,12 @@
             self.dispatch(t.step)
 
     def _ExtSlice(self, t):
-        interleave(lambda: self.write(', '), self.dispatch, t.dims)
+        if len(t.dims) == 1:
+            elt = t.dims[0]
+            self.dispatch(elt)
+            self.write(",")
+        else:
+            interleave(lambda: self.write(', '), self.dispatch, t.dims)
 
     # argument
     def _arg(self, t):
diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py
index 3fb4985..d60f352 100755
--- a/Tools/ssl/make_ssl_data.py
+++ b/Tools/ssl/make_ssl_data.py
@@ -11,6 +11,7 @@
 """
 
 import datetime
+import glob
 import os
 import re
 import sys
@@ -18,7 +19,7 @@
 
 
 def parse_error_codes(h_file, prefix, libcode):
-    pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix))
+    pat = re.compile(r"#\s*define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix))
     codes = []
     with open(h_file, "r", encoding="latin1") as f:
         for line in f:
@@ -28,6 +29,7 @@
                 num = int(num)
                 # e.g. ("SSL_R_BAD_DATA", ("ERR_LIB_SSL", "BAD_DATA", 390))
                 codes.append((code, (libcode, name, num)))
+    assert codes, f"no codes found in {h_file}"
     return codes
 
 if __name__ == "__main__":
@@ -35,18 +37,27 @@
     outfile = sys.argv[2]
     use_stdout = outfile == '-'
     f = sys.stdout if use_stdout else open(outfile, "w")
-    error_libraries = {
-        # mnemonic -> (library code, error prefix, header file)
-        'PEM': ('ERR_LIB_PEM', 'PEM_R_', 'crypto/pem/pem.h'),
-        'SSL': ('ERR_LIB_SSL', 'SSL_R_', 'ssl/ssl.h'),
-        'X509': ('ERR_LIB_X509', 'X509_R_', 'crypto/x509/x509.h'),
-        }
+    # mnemonic -> (library code, error prefix, header file)
+    error_libraries = {}
+    for error_header in glob.glob(os.path.join(openssl_inc, 'include/openssl/*err.h')):
+        base = os.path.basename(error_header)
+        if base in ('buffererr.h', 'objectserr.h', 'storeerr.h'):
+            # Deprecated in 3.0.
+            continue
+        mnemonic = base[:-5].upper()
+        if mnemonic == "":
+            # err.h
+            lib_codes = {
+                code: num
+                for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None)
+            }
+        else:
+            error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header)
 
     # Read codes from libraries
     new_codes = []
     for libcode, prefix, h_file in sorted(error_libraries.values()):
-        new_codes += parse_error_codes(os.path.join(openssl_inc, h_file),
-                                       prefix, libcode)
+        new_codes += parse_error_codes(h_file, prefix, libcode)
     new_code_nums = set((libcode, num)
                         for (code, (libcode, name, num)) in new_codes)
 
@@ -69,7 +80,9 @@
 
     w("static struct py_ssl_library_code library_codes[] = {")
     for mnemo, (libcode, _, _) in sorted(error_libraries.items()):
+        w(f'#ifdef {libcode}')
         w('    {"%s", %s},' % (mnemo, libcode))
+        w('#endif')
     w('    { NULL }')
     w('};')
     w("")
@@ -79,7 +92,7 @@
         w('  #ifdef %s' % (errcode))
         w('    {"%s", %s, %s},' % (name, libcode, errcode))
         w('  #else')
-        w('    {"%s", %s, %d},' % (name, libcode, num))
+        w('    {"%s", %s, %d},' % (name, lib_codes[libcode], num))
         w('  #endif')
     w('    { NULL }')
     w('};')
diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
index d816810..05d6d7d 100755
--- a/Tools/ssl/multissltests.py
+++ b/Tools/ssl/multissltests.py
@@ -47,7 +47,7 @@
 OPENSSL_RECENT_VERSIONS = [
     "1.0.2t",
     "1.1.0l",
-    "1.1.1d",
+    "1.1.1f",
 ]
 
 LIBRESSL_OLD_VERSIONS = [
diff --git a/aclocal.m4 b/aclocal.m4
index 85f00dd..f98db73 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/configure b/configure
index a979363..8886561 100755
--- a/configure
+++ b/configure
@@ -826,6 +826,7 @@
 with_system_expat
 with_system_ffi
 with_system_libmpdec
+with_decimal_contextvar
 enable_loadable_sqlite_extensions
 with_tcltk_includes
 with_tcltk_libs
@@ -1529,6 +1530,9 @@
   --with-system-ffi       build _ctypes module using an installed ffi library
   --with-system-libmpdec  build _decimal module using an installed libmpdec
                           library
+  --with-decimal-contextvar
+                          build _decimal module using a coroutine-local rather
+                          than a thread-local context (default is yes)
   --with-tcltk-includes='-I...'
                           override search for Tcl and Tk include files
   --with-tcltk-libs='-L...'
@@ -10419,6 +10423,28 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_libmpdec" >&5
 $as_echo "$with_system_libmpdec" >&6; }
 
+# Check whether _decimal should use a coroutine-local or thread-local context
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-decimal-contextvar" >&5
+$as_echo_n "checking for --with-decimal-contextvar... " >&6; }
+
+# Check whether --with-decimal_contextvar was given.
+if test "${with_decimal_contextvar+set}" = set; then :
+  withval=$with_decimal_contextvar;
+else
+  with_decimal_contextvar="yes"
+fi
+
+
+if test "$with_decimal_contextvar" != "no"
+then
+
+$as_echo "#define WITH_DECIMAL_CONTEXTVAR 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_decimal_contextvar" >&5
+$as_echo "$with_decimal_contextvar" >&6; }
+
 # Check for support for loadable sqlite extensions
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5
 $as_echo_n "checking for --enable-loadable-sqlite-extensions... " >&6; }
@@ -14277,10 +14303,10 @@
 if ac_fn_c_try_compile "$LINENO"; then :
 
 
-if grep noonsees conftest.$ac_objext >/dev/null ; then
+if $GREP noonsees conftest.$ac_objext >/dev/null ; then
   ax_cv_c_float_words_bigendian=yes
 fi
-if grep seesnoon conftest.$ac_objext >/dev/null ; then
+if $GREP seesnoon conftest.$ac_objext >/dev/null ; then
   if test "$ax_cv_c_float_words_bigendian" = unknown; then
     ax_cv_c_float_words_bigendian=no
   else
diff --git a/configure.ac b/configure.ac
index e57ef7c..d8de9d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3004,6 +3004,21 @@
 
 AC_MSG_RESULT($with_system_libmpdec)
 
+# Check whether _decimal should use a coroutine-local or thread-local context
+AC_MSG_CHECKING(for --with-decimal-contextvar)
+AC_ARG_WITH(decimal_contextvar,
+            AS_HELP_STRING([--with-decimal-contextvar], [build _decimal module using a coroutine-local rather than a thread-local context (default is yes)]),
+            [],
+            [with_decimal_contextvar="yes"])
+
+if test "$with_decimal_contextvar" != "no"
+then
+    AC_DEFINE(WITH_DECIMAL_CONTEXTVAR, 1,
+      [Define if you want build the _decimal module using a coroutine-local rather than a thread-local context])
+fi
+
+AC_MSG_RESULT($with_decimal_contextvar)
+
 # Check for support for loadable sqlite extensions
 AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
 AC_ARG_ENABLE(loadable-sqlite-extensions,
diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4
index 216b90d..746228c 100644
--- a/m4/ax_c_float_words_bigendian.m4
+++ b/m4/ax_c_float_words_bigendian.m4
@@ -49,10 +49,10 @@
 
 ]])], [
 
-if grep noonsees conftest.$ac_objext >/dev/null ; then
+if $GREP noonsees conftest.$ac_objext >/dev/null ; then
   ax_cv_c_float_words_bigendian=yes
 fi
-if grep seesnoon conftest.$ac_objext >/dev/null ; then
+if $GREP seesnoon conftest.$ac_objext >/dev/null ; then
   if test "$ax_cv_c_float_words_bigendian" = unknown; then
     ax_cv_c_float_words_bigendian=no
   else
diff --git a/pyconfig.h.in b/pyconfig.h.in
index aaa7b72..4263a71 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1518,6 +1518,10 @@
 /* Define if WINDOW in curses.h offers a field _flags. */
 #undef WINDOW_HAS_FLAGS
 
+/* Define if you want build the _decimal module using a coroutine-local rather
+   than a thread-local context */
+#undef WITH_DECIMAL_CONTEXTVAR
+
 /* Define if you want documentation strings in extension modules */
 #undef WITH_DOC_STRINGS
 
diff --git a/setup.py b/setup.py
index 20d7f35..b168ed4 100644
--- a/setup.py
+++ b/setup.py
@@ -146,7 +146,7 @@
         return MACOS_SDK_ROOT
 
     cflags = sysconfig.get_config_var('CFLAGS')
-    m = re.search(r'-isysroot\s+(\S+)', cflags)
+    m = re.search(r'-isysroot\s*(\S+)', cflags)
     if m is not None:
         MACOS_SDK_ROOT = m.group(1)
     else: