Skip to content

Allow keyword errors for codec decoders - #16446

Closed
jw9829 wants to merge 2 commits into
python:mainfrom
jw9829:fix-codecs-decoder-keyword-errors
Closed

jw9829 wants to merge 2 commits into
python:mainfrom
jw9829:fix-codecs-decoder-keyword-errors

Conversation

@jw9829

@jw9829 jw9829 commented Sep 27, 2026 •

Copy link
Copy Markdown

Fixes #16441.

The decoder already accepts errors= at runtime. Move the / so input stays positional-only and errors can be passed by keyword.

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

python-chess (https://github.com/niklasf/python-chess)
+ error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 2.3.0
+ note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+   File "/__main__.py", line 16, in console_entry
+     main()
+     ~~~~^^
+   File "mypy/main.py", line 154, in main
+   File "mypy/main.py", line 244, in run_build
+     res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+   File "mypy/build.py", line 385, in build
+   File "mypy/build.py", line 1908, in create_metastore
+     mds: MetadataStore = SqliteMetadataStore(
+   File "mypy/metastore.py", line 200, in __init__
+   File "mypy/metastore.py", line 174, in connect_db
+     db.execute("PRAGMA journal_mode=WAL")
+ sqlite3.OperationalError: database is locked
+ 

async-utils (https://github.com/mikeshardmind/async-utils)
- src/async_utils/_merge_gens.py:211: error: Argument 2 to "anext" has incompatible type "Task[T] | None"; expected "T"  [arg-type]
- src/async_utils/_merge_gens.py:262: error: Argument 2 to "anext" has incompatible type "Task[T] | None"; expected "T"  [arg-type]
- src/async_utils/_merge_gens.py:314: error: Argument 2 to "anext" has incompatible type "Task[T] | None"; expected "T"  [arg-type]
+ error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 2.3.0
+ note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+   File "/__main__.py", line 16, in console_entry
+     main()
+     ~~~~^^
+   File "mypy/main.py", line 154, in main
+   File "mypy/main.py", line 244, in run_build
+     res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+   File "mypy/build.py", line 385, in build
+   File "mypy/build.py", line 1908, in create_metastore
+     mds: MetadataStore = SqliteMetadataStore(
+   File "mypy/metastore.py", line 200, in __init__
+   File "mypy/metastore.py", line 174, in connect_db
+     db.execute("PRAGMA journal_mode=WAL")
+ sqlite3.OperationalError: database is locked
+ 

@jw9829 jw9829 closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

false alarm on decode call

1 participant