Skip to content

Setting None to skip_file_prefixes of warnings.warn() gets error #125818

Closed
@hyperkai

Description

@hyperkai

Bug report

Bug description:

The doc of warnings.warn() says skip_file_prefixes is None by default as shown below:

warnings.warn(message, category=None, stacklevel=1, source=None, *, skip_file_prefixes=None)

But, setting None to skip_file_prefixes gets the error as shown below:

import warnings

warnings.warn(message='Warning',
              category=None,
              stacklevel=1,
              source=None,
              skip_file_prefixes=None) # Error
            # ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑

TypeError: warn() argument 'skip_file_prefixes' must be tuple, not None

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions