Skip to content

Use of deprecated & insecure tempfile.mktemp() #1752

@MIS-Alex

Description

@MIS-Alex

Expected Behavior

_tempfilepager() in _termui_impl.py uses a depreciated function that is considered insecure by the core Python team. It is recommended to use mkstemp() instead.

import tempfile
filename = tempfile.mkstemp()  # Suggested replacement

Actual Behavior

Python's warning:

Use of this function may introduce a security hole in your program. By the time you get around to doing anything with the file name it returns, someone else may have beaten you to the punch.

import tempfile
filename = tempfile.mktemp()  # Depreciated and insecure

Environment

  • Python version: 3.8.5
  • Click version: 7.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions