Skip to content

Commit

Permalink
Add workaround to prevent crash on Windows when the SSLKEYLOGFILE e…
Browse files Browse the repository at this point in the history
…nvironment variable is set (#89)

* add a workaround for SSLKEYLOGFILE

* only windows

* Add GHA artifacts

* add news

* pre-commit
  • Loading branch information
jaimergp authored Aug 9, 2024
1 parent ea40331 commit daaa315
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
subdir: osx-arm64
- os: windows-latest
subdir: win-64
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: conda-incubator/setup-miniconda@v3
Expand All @@ -53,6 +55,12 @@ jobs:
CONDA_BLD_PATH: ${{ runner.temp }}/bld
run: conda build recipe --override-channels -c conda-forge

- uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
with:
name: conda-standalone-${{ matrix.subdir }}
path: ${{ runner.temp }}/bld/${{ matrix.subdir }}/conda-standalone-*.*

- name: Upload package to anaconda.org
shell: bash -el {0}
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand All @@ -72,7 +80,7 @@ jobs:
--label="${ANACONDA_ORG_LABEL}" \
${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-standalone-*.*
echo "Uploaded the following files:"
basename -a ${CONDA_BLD_PATH}/pkgs/${{ matrix.subdir }}/conda-standalone-*.*
basename -a ${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-standalone-*.*
echo "Use this command to try out the build:"
echo " conda install -c ${ANACONDA_ORG_CHANNEL}/label/${ANACONDA_ORG_LABEL} conda-standalone"
19 changes: 19 additions & 0 deletions news/89-openssl-applink
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Add workaround to prevent crash on Windows when the `SSLKEYLOGFILE` environment variable is set. (#86 via #89).

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
6 changes: 6 additions & 0 deletions src/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
from multiprocessing import freeze_support
from pathlib import Path

if os.name == "nt" and "SSLKEYLOGFILE" in os.environ:
# This causes a crash with requests 2.32+ on Windows
# Root cause is 'urllib3.util.ssl_.create_urllib3_context()'
# See https://github.com/conda/conda-standalone/issues/86
del os.environ["SSLKEYLOGFILE"]


def _create_dummy_executor(*args, **kwargs):
"use this for debugging, because ProcessPoolExecutor isn't pdb/ipdb friendly"
Expand Down

0 comments on commit daaa315

Please sign in to comment.