Skip to content

Commit 6cca041

Browse files
authored
Merge pull request #1966 from dbcli/RW/use-os-path-samefile-for-checkpoint-test
Prefer `os.path.samefile()` for checkpoint file distinctness test
2 parents e83b44a + 1608cdc commit 6cca041

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Internal
3939
* Improve test coverage for DSN variable expansion.
4040
* Test on all platforms in the Publish GitHub Action.
4141
* Remove unused support for writing `.mylogin.cnf` files.
42+
* Prefer `os.path.samefile()` for checkpoint distinctness test.
4243

4344

4445
1.76.0 (2026/06/20)

mycli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def preprocess_cli_args(
386386
and cli_args.batch != '-'
387387
and os.path.exists(cli_args.batch)
388388
):
389-
if os.stat(cli_args.batch) == os.stat(cli_args.checkpoint):
389+
if os.path.samefile(cli_args.batch, cli_args.checkpoint):
390390
click.secho('Error: --batch and --checkpoint must be different files.', err=True, fg='red')
391391
sys.exit(1)
392392

0 commit comments

Comments
 (0)