Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jupyter/jupyter_client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.4.3
Choose a base ref
...
head repository: jupyter/jupyter_client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4029f6cad9223b1287980a1f0e966ff66557386e
Choose a head ref
  • 1 commit
  • 1 file changed
  • 2 contributors

Commits on Oct 24, 2022

  1. Backport PR #861 on branch 7.x (Workaround for launch bug) (#862)

    Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
    meeseeksmachine and blink1073 authored Oct 24, 2022
    Copy the full SHA
    4029f6c View commit details
Showing with 12 additions and 0 deletions.
  1. +12 −0 jupyter_client/connect.py
12 changes: 12 additions & 0 deletions jupyter_client/connect.py
Original file line number Diff line number Diff line change
@@ -158,6 +158,18 @@ def write_connection_file(
cfg["signature_scheme"] = signature_scheme
cfg["kernel_name"] = kernel_name

# Prevent over-writing a file that has already been written with the same
# info. This is to prevent a race condition where the process has
# already been launched but has not yet read the connection file.
if os.path.exists(fname):
with open(fname) as f:
try:
data = json.load(f)
if data == cfg:
return fname, cfg
except Exception:
pass

# Only ever write this file as user read/writeable
# This would otherwise introduce a vulnerability as a file has secrets
# which would let others execute arbitrarily code as you