Skip to content

Commit 03f474c

Browse files
authored
Merge branch 'SeleniumHQ:trunk' into py-enable-chrome-logs-flag
2 parents 4196f05 + 0ff768a commit 03f474c

File tree

12 files changed

+237
-224
lines changed

12 files changed

+237
-224
lines changed

java/src/org/openqa/selenium/manager/SeleniumManager.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
// under the License.
1717
package org.openqa.selenium.manager;
1818

19+
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
20+
import static java.util.Objects.requireNonNull;
21+
import static java.util.UUID.randomUUID;
1922
import static org.openqa.selenium.Platform.LINUX;
2023
import static org.openqa.selenium.Platform.MAC;
2124
import static org.openqa.selenium.Platform.UNIX;
@@ -213,11 +216,12 @@ private synchronized Path getBinary() {
213216
}
214217

215218
binary = getBinaryInCache(SELENIUM_MANAGER + extension);
216-
if (!binary.toFile().exists()) {
219+
if (!Files.exists(binary)) {
217220
String binaryPathInJar = String.format("%s/%s%s", folder, SELENIUM_MANAGER, extension);
218-
try (InputStream inputStream = this.getClass().getResourceAsStream(binaryPathInJar)) {
221+
try (InputStream inputStream =
222+
requireNonNull(getClass().getResourceAsStream(binaryPathInJar))) {
219223
Files.createDirectories(binary.getParent());
220-
Files.copy(inputStream, binary);
224+
saveToFileSafely(inputStream, binary);
221225
}
222226
}
223227
} catch (Exception e) {
@@ -233,6 +237,22 @@ private synchronized Path getBinary() {
233237
return binary;
234238
}
235239

240+
/**
241+
* Protect from concurrency issue when executed by 2+ processes simultaneously. Every process sees
242+
* the file created by another process only when the file is fully completed.
243+
*/
244+
private void saveToFileSafely(InputStream inputStream, Path target) throws IOException {
245+
Path temporaryFile = target.resolveSibling(target.getFileName() + "." + randomUUID() + ".tmp");
246+
Files.copy(inputStream, temporaryFile);
247+
try {
248+
if (!Files.exists(target)) {
249+
Files.move(temporaryFile, target, REPLACE_EXISTING);
250+
}
251+
} finally {
252+
Files.deleteIfExists(temporaryFile);
253+
}
254+
}
255+
236256
/**
237257
* Executes Selenium Manager to get the locations of the requested assets
238258
*

multitool.lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@
44
"binaries": [
55
{
66
"kind": "archive",
7-
"url": "https://github.com/astral-sh/ruff/releases/download/0.12.10/ruff-aarch64-unknown-linux-musl.tar.gz",
7+
"url": "https://github.com/astral-sh/ruff/releases/download/0.13.0/ruff-aarch64-unknown-linux-musl.tar.gz",
88
"file": "ruff-aarch64-unknown-linux-musl/ruff",
9-
"sha256": "10b43a88fb948aaae538ec9f35e93b4433f144d0379fb3a67d88282595b969f7",
9+
"sha256": "bdee6f1376470b74b1dc5ed48eca52ec9c3e4512bd7f3204e0df100f0bed4741",
1010
"os": "linux",
1111
"cpu": "arm64"
1212
},
1313
{
1414
"kind": "archive",
15-
"url": "https://github.com/astral-sh/ruff/releases/download/0.12.10/ruff-x86_64-unknown-linux-musl.tar.gz",
15+
"url": "https://github.com/astral-sh/ruff/releases/download/0.13.0/ruff-x86_64-unknown-linux-musl.tar.gz",
1616
"file": "ruff-x86_64-unknown-linux-musl/ruff",
17-
"sha256": "dd4e5b8f81547a48975489913a80e0dce6be7f1c455912fe3a5bd5a1f5f1a35d",
17+
"sha256": "b56ac90cc6987401bafdcf1b931ef044074c5b9451286afa4606a983f64f4fdd",
1818
"os": "linux",
1919
"cpu": "x86_64"
2020
},
2121
{
2222
"kind": "archive",
23-
"url": "https://github.com/astral-sh/ruff/releases/download/0.12.10/ruff-aarch64-apple-darwin.tar.gz",
23+
"url": "https://github.com/astral-sh/ruff/releases/download/0.13.0/ruff-aarch64-apple-darwin.tar.gz",
2424
"file": "ruff-aarch64-apple-darwin/ruff",
25-
"sha256": "72c6abf39f5e87c57faa2d191baf2582e437ff72cdc0f52b7c7e50f26d41b807",
25+
"sha256": "0d706798534537b6655b79fd95c2955c0a0013d4c54d36679d3306825a6bd6aa",
2626
"os": "macos",
2727
"cpu": "arm64"
2828
},
2929
{
3030
"kind": "archive",
31-
"url": "https://github.com/astral-sh/ruff/releases/download/0.12.10/ruff-x86_64-apple-darwin.tar.gz",
31+
"url": "https://github.com/astral-sh/ruff/releases/download/0.13.0/ruff-x86_64-apple-darwin.tar.gz",
3232
"file": "ruff-x86_64-apple-darwin/ruff",
33-
"sha256": "8619f277921b3e2e56d850c3e203fd4ef10b457bc50f93ab6fe85743eb324de6",
33+
"sha256": "ac47ad1ac90f3070c064d2f5fceef4fe609fec7c073fd29d0814ed126c492e6d",
3434
"os": "macos",
3535
"cpu": "x86_64"
3636
},
3737
{
3838
"kind": "archive",
39-
"url": "https://github.com/astral-sh/ruff/releases/download/0.12.10/ruff-x86_64-pc-windows-msvc.zip",
39+
"url": "https://github.com/astral-sh/ruff/releases/download/0.13.0/ruff-x86_64-pc-windows-msvc.zip",
4040
"file": "ruff-x86_64-pc-windows-msvc/ruff.exe",
41-
"sha256": "a639e4dee10cb2900bffa7165457766671c59c744ce6b61cc658c35ab33a91fd",
41+
"sha256": "3a8d8cb96333671f78a5d209ddb4f830287e3eb2796fe01dd043b02ec1c1c7f1",
4242
"os": "windows",
4343
"cpu": "x86_64"
4444
}

py/docs/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ webdriver.common.bidi
9696
selenium.webdriver.common.bidi.common
9797
selenium.webdriver.common.bidi.console
9898
selenium.webdriver.common.bidi.emulation
99+
selenium.webdriver.common.bidi.input
99100
selenium.webdriver.common.bidi.log
100101
selenium.webdriver.common.bidi.network
101102
selenium.webdriver.common.bidi.permissions

py/requirements.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
attrs==25.3.0
2-
cachetools==6.1.0
2+
cachetools==6.2.0
33
certifi==2025.8.3
4-
cffi==1.17.1
4+
cffi==2.0.0
55
chardet==5.2.0
66
charset-normalizer==3.4.3
77
colorama==0.4.6
8-
cryptography==45.0.6
8+
cryptography==45.0.7
99
debugpy==1.8.16
1010
distlib==0.4.0
1111
docutils==0.21.2
@@ -24,21 +24,21 @@ jeepney==0.9.0
2424
keyring==25.6.0
2525
markdown-it-py==3.0.0
2626
mdurl==0.1.2
27-
more-itertools==10.7.0
27+
more-itertools==10.8.0
2828
multidict==6.6.4
2929
nh3==0.3.0
3030
outcome==1.3.0.post0
3131
packaging==25.0
32-
platformdirs==4.3.8
32+
platformdirs==4.4.0
3333
pluggy==1.6.0
3434
py==1.11.0
35-
pycparser==2.22
35+
pycparser==2.23
3636
Pygments==2.19.2
3737
pyproject-api==1.9.1
3838
PySocks==1.7.1
39-
pytest==8.4.1
39+
pytest==8.4.2
4040
pytest-instafail==0.5.0
41-
pytest-mock==3.14.1
41+
pytest-mock==3.15.0
4242
pytest-trio==0.8.0
4343
pywin32-ctypes==0.2.3
4444
readme_renderer==44.0
@@ -49,11 +49,11 @@ rich==14.1.0
4949
SecretStorage==3.3.3
5050
sniffio==1.3.1
5151
sortedcontainers==2.4.0
52-
tox==4.28.4
53-
trio==0.30.0
52+
tox==4.30.2
53+
trio==0.31.0
5454
trio-websocket==0.12.2
55-
twine==6.1.0
56-
typing_extensions==4.14.1
55+
twine==6.2.0
56+
typing_extensions==4.15.0
5757
urllib3[socks]==2.5.0
5858
virtualenv==20.34.0
5959
websocket-client==1.8.0

0 commit comments

Comments
 (0)