Skip to content

Commit 9d672ba

Browse files
committed
Merge branch 'main' into frozendict_copy
2 parents 6947aec + 0c29f83 commit 9d672ba

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

.github/actionlint.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
self-hosted-runner:
2-
# Pending https://github.com/rhysd/actionlint/pull/615
3-
labels: ["windows-2025-vs2026"]
4-
51
config-variables: null
62

73
paths:

.github/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration for the zizmor static analysis tool, run via prek in CI
2-
# https://woodruffw.github.io/zizmor/configuration/
2+
# https://docs.zizmor.sh/configuration/
33
rules:
44
dangerous-triggers:
55
ignore:

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.15.0
3+
rev: a27a2e47c7751b639d2b5badf0ef6ff11fee893f # frozen: v0.15.4
44
hooks:
55
- id: ruff-check
66
name: Run Ruff (lint) on Apple/
@@ -60,20 +60,20 @@ repos:
6060
files: ^Tools/wasm/
6161

6262
- repo: https://github.com/psf/black-pre-commit-mirror
63-
rev: 26.1.0
63+
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
6464
hooks:
6565
- id: black
6666
name: Run Black on Tools/jit/
6767
files: ^Tools/jit/
6868

6969
- repo: https://github.com/Lucas-C/pre-commit-hooks
70-
rev: v1.5.6
70+
rev: ad1b27d73581aa16cca06fc4a0761fc563ffe8e8 # frozen: v1.5.6
7171
hooks:
7272
- id: remove-tabs
7373
types: [python]
7474

7575
- repo: https://github.com/pre-commit/pre-commit-hooks
76-
rev: v6.0.0
76+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
7777
hooks:
7878
- id: check-case-conflict
7979
- id: check-merge-conflict
@@ -91,24 +91,24 @@ repos:
9191
files: '^\.github/CODEOWNERS|\.(gram)$'
9292

9393
- repo: https://github.com/python-jsonschema/check-jsonschema
94-
rev: 0.36.1
94+
rev: 9f48a48aa91a6040d749ad68ec70907d907a5a7f # frozen: 0.37.0
9595
hooks:
9696
- id: check-dependabot
9797
- id: check-github-workflows
9898
- id: check-readthedocs
9999

100100
- repo: https://github.com/rhysd/actionlint
101-
rev: v1.7.10
101+
rev: 393031adb9afb225ee52ae2ccd7a5af5525e03e8 # frozen: v1.7.11
102102
hooks:
103103
- id: actionlint
104104

105-
- repo: https://github.com/woodruffw/zizmor-pre-commit
106-
rev: v1.22.0
105+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
106+
rev: b546b77c44c466a54a42af5499dcc0dcc1a3193f # frozen: v1.22.0
107107
hooks:
108108
- id: zizmor
109109

110110
- repo: https://github.com/sphinx-contrib/sphinx-lint
111-
rev: v1.0.2
111+
rev: c883505f64b59c3c5c9375191e4ad9f98e727ccd # frozen: v1.0.2
112112
hooks:
113113
- id: sphinx-lint
114114
args: [--enable=default-role]

Lib/test/test_venv.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
import os.path
1212
import pathlib
1313
import re
14+
import shlex
1415
import shutil
1516
import subprocess
1617
import sys
1718
import sysconfig
1819
import tempfile
19-
import shlex
2020
from test.support import (captured_stdout, captured_stderr,
2121
skip_if_broken_multiprocessing_synchronize, verbose,
2222
requires_subprocess, is_android, is_apple_mobile,
@@ -373,6 +373,16 @@ def create_contents(self, paths, filename):
373373
with open(fn, 'wb') as f:
374374
f.write(b'Still here?')
375375

376+
@unittest.skipUnless(hasattr(os, 'listxattr'), 'test requires os.listxattr')
377+
def test_install_scripts_selinux(self):
378+
"""
379+
gh-145417: Test that install_scripts does not copy SELinux context
380+
when copying scripts.
381+
"""
382+
with patch('os.listxattr') as listxattr_mock:
383+
venv.create(self.env_dir)
384+
listxattr_mock.assert_not_called()
385+
376386
def test_overwrite_existing(self):
377387
"""
378388
Test creating environment in an existing directory.

Lib/venv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def skip_file(f):
581581
'may be binary: %s', srcfile, e)
582582
continue
583583
if new_data == data:
584-
shutil.copy2(srcfile, dstfile)
584+
shutil.copy(srcfile, dstfile)
585585
else:
586586
with open(dstfile, 'wb') as f:
587587
f.write(new_data)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:mod:`venv`: Prevent incorrect preservation of SELinux context
2+
when copying the ``Activate.ps1`` script. The script inherited
3+
the SELinux security context of the system template directory,
4+
rather than the destination project directory.

Objects/dictobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ dict_unhashable_type(PyObject *op, PyObject *key)
24072407
}
24082408

24092409
const char *errmsg;
2410-
if (PyObject_IsInstance(op, (PyObject*)&PyFrozenDict_Type)) {
2410+
if (PyFrozenDict_Check(op)) {
24112411
errmsg = "cannot use '%T' as a frozendict key (%S)";
24122412
}
24132413
else {
@@ -4403,7 +4403,7 @@ PyDict_Copy(PyObject *o)
44034403
// Similar to PyDict_Copy(), but return a frozendict if the argument
44044404
// is a frozendict.
44054405
static PyObject *
4406-
_PyDict_Copy(PyObject *o)
4406+
anydict_copy(PyObject *o)
44074407
{
44084408
assert(PyAnyDict_Check(o));
44094409

@@ -4973,7 +4973,7 @@ dict_or(PyObject *self, PyObject *other)
49734973
if (!PyAnyDict_Check(self) || !PyAnyDict_Check(other)) {
49744974
Py_RETURN_NOTIMPLEMENTED;
49754975
}
4976-
PyObject *new = _PyDict_Copy(self);
4976+
PyObject *new = anydict_copy(self);
49774977
if (new == NULL) {
49784978
return NULL;
49794979
}
@@ -8202,7 +8202,7 @@ frozendict_copy_impl(PyFrozenDictObject *self)
82028202
return Py_NewRef(self);
82038203
}
82048204

8205-
return _PyDict_Copy((PyObject*)self);
8205+
return anydict_copy((PyObject*)self);
82068206
}
82078207

82088208

0 commit comments

Comments
 (0)