GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — false alarm on decode call · Issue #16441 · python/typeshed

false alarm on decode call #16441

New issue
Copy link
New issue
Copy link
Open
#16447
Open
false alarm on decode call#16441
#16447
Copy link
Labels
help wantedAn actionable problem of low to medium complexity where a PR would be very welcomeAn actionable problem of low to medium complexity where a PR would be very welcomestubs: false positiveType checkers report false errorsType checkers report false errors

Description

@florianschanda
florianschanda
opened on Sep 25, 2026
Issue body actions

Bug Report

The following file is legal python, as far as I understand it:

import codecs

a = codecs.lookup("UTF-8")
b = bytes(b"potato")
c = a.decode(b, errors="replace")

Running mypy 2.3.1 produces:

$ mypy wibble.py
wibble.py:5: error: Unexpected keyword argument "errors" for "__call__" of "_Decoder"  [call-arg]
wibble.py:5: note: "__call__" defined in "codecs"

To Reproduce

https://mypy-play.net/?mypy=latest&python=latest&gist=e34d60fa6ddb3835c9d2dae7eae7a301

Expected Behavior

I would expect no message at all. Reasoning:

  • https://docs.python.org/3/library/codecs.html#codecs.lookup describes what is returned from lookup
  • https://docs.python.org/3/library/codecs.html#codecs.CodecInfo describes required API
  • https://docs.python.org/3/library/codecs.html#codecs.Codec.decode describes that errors is parameter

Actual Behavior

False alarm is issued.

Your Environment

  • Mypy version used: 2.3.1
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 2.13.5 (from Debian trixie)

Activity

  1. ilevkivskyi commented on Sep 25, 2026

    @ilevkivskyi
    ilevkivskyi
    on Sep 25, 2026
    Member
    More actions

    It is annotated as positional-only in typeshed, transferring there.

  2. ilevkivskyi
    transferred this issue frompython/mypyon Sep 25, 2026
  3. srittau
    added
    stubs: false positiveType checkers report false errorsType checkers report false errors
    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomeAn actionable problem of low to medium complexity where a PR would be very welcome
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomeAn actionable problem of low to medium complexity where a PR would be very welcomestubs: false positiveType checkers report false errorsType checkers report false errors

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.