Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Internal
* Upgrade `sqlparse` dependency to v0.6.0.
* Upgrade optional `pip` dependency to v26.2.1.
* Use cache and turn off distro update for WSL tests in CI.
* Upgrade `click` dependency to v8.5.0.


2.18.5 (2026/08/31)
Expand Down
3 changes: 1 addition & 2 deletions mycli/main_modes/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ def main_batch_without_progress_bar(mycli: 'MyCli', cli_args: 'CliArgs') -> int:


def main_batch_from_stdin(mycli: 'MyCli', cli_args: 'CliArgs') -> int:
batch_h = click.get_text_stream('stdin')
try:
for statement, counter in statements_from_filehandle(batch_h):
for statement, counter in statements_from_filehandle(sys.stdin):
dispatch_batch_statements(mycli, cli_args, statement, counter)
except (ValueError, StopIteration, IOError, OSError, pymysql.err.Error) as e:
click.secho(str(e), err=True, fg='red')
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ classifiers = [
]

dependencies = [
# TODO click 8.4.2 breaks the pager on Windows; check the next
# version after 8.4.2 for https://github.com/pallets/click/pull/3739
# which has been merged. The click changelog predicts the next
# version to be 8.5.0, which can be merged around 2 Sep 2026.
"click ~= 8.3.3",
"click ~= 8.5.0",
"clickdc ~= 0.1.1",
"cryptography ~= 50.0.0",
"Pygments ~= 2.21.0",
Expand Down
3 changes: 0 additions & 3 deletions test/pytests/test_main_modes_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,7 @@ def test_main_batch_without_progress_bar_returns_error_when_iteration_fails(monk

def test_main_batch_from_stdin_processes_statements(monkeypatch) -> None:
dispatch_calls: list[tuple[str, int]] = []
batch_handle = object()

monkeypatch.setattr(batch_mode.click, 'get_text_stream', lambda _name: batch_handle)
monkeypatch.setattr(batch_mode, 'statements_from_filehandle', lambda _handle: iter([('select 1;', 0), ('select 2;', 1)]))
monkeypatch.setattr(
batch_mode,
Expand All @@ -817,7 +815,6 @@ def test_main_batch_from_stdin_processes_statements(monkeypatch) -> None:
def test_main_batch_from_stdin_returns_error_for_value_errors(monkeypatch) -> None:
messages: list[tuple[str, bool, str]] = []

monkeypatch.setattr(batch_mode.click, 'get_text_stream', lambda _name: object())
monkeypatch.setattr(batch_mode, 'statements_from_filehandle', lambda _handle: (_ for _ in ()).throw(ValueError('bad stdin')))
monkeypatch.setattr(batch_mode.click, 'secho', lambda message, err, fg: messages.append((message, err, fg)))

Expand Down
Loading