python / python/cpython

In mac, terminal freezes when taking JWT token as getpass input

Open
#157,538 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

Issue Title: Terminal freezes on macOS when passing a JWT token via getpass
Summary
When attempting to input a long string—specifically a JSON Web Token (JWT)—using Python's getpass module in the macOS Terminal, the terminal application hangs and freezes completely, requiring a force quit.

Steps to Reproduce
Open Terminal (or iTerm2) on macOS.

Run a Python script or interactive shell that calls getpass.getpass().

Paste a standard long JWT string into the prompt.

Observe the terminal freeze/hang.

Expected Behavior
The terminal should accept the input securely (masking characters if applicable) without locking up, allowing the script to proceed.

Actual Behavior
The terminal interface stops responding entirely

Environment
OS: macOS (any version 10+)

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Linked PRs
  • gh-157805

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing getpass.getpass() in macOS Terminal or iTerm2 with a long JWT, then inspect linked PR gh-157805 for the work already underway. Done means the terminal remains responsive and the script proceeds after the JWT is pasted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.