From 1608cdc3e38ea277dab857fb20f48fd894cbc279 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Wed, 24 Jun 2026 06:09:14 -0400 Subject: [PATCH] prefer os.path.samefile() for checkpoint test --- changelog.md | 1 + mycli/main.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index ddec8fcd..95e7c1bd 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,7 @@ Internal * Improve test coverage for DSN variable expansion. * Test on all platforms in the Publish GitHub Action. * Remove unused support for writing `.mylogin.cnf` files. +* Prefer `os.path.samefile()` for checkpoint distinctness test. 1.76.0 (2026/06/20) diff --git a/mycli/main.py b/mycli/main.py index 28a7f403..ea22adf9 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -329,7 +329,7 @@ def preprocess_cli_args( and cli_args.batch != '-' and os.path.exists(cli_args.batch) ): - if os.stat(cli_args.batch) == os.stat(cli_args.checkpoint): + if os.path.samefile(cli_args.batch, cli_args.checkpoint): click.secho('Error: --batch and --checkpoint must be different files.', err=True, fg='red') sys.exit(1)