Registry / testing / pyreadline3

pyreadline3

JSON →
library3.5.6pypypi✓ verified 27d ago

pyreadline3 is a Python implementation of GNU readline functionality, primarily designed for Windows environments where the native `readline` module is not available. It is a continuation of the `pyreadline` package, providing features like command history, tab completion, and keyboard shortcuts. Version 3.4+ of pyreadline3 supports Python 3.8+ and is actively maintained.

pip install pyreadline3
INSTALL
IMPORT
SIG · PYREADLINE3
P
pyreadline3
testingpythonv3.5.6
Install
1.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.5.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

readline
import readline
On Windows, pyreadline3 typically patches the built-in 'readline' module, making it available as if it were the standard Unix 'readline' library.
Readline
from pyreadline3 import Readline
Directly import the Readline class for explicit control or when the implicit patching of the 'readline' module is not desired or working as expected.

This quickstart demonstrates how pyreadline3 makes the `readline` module available and functional on Windows. After installation, `import readline` should seamlessly provide command-line editing features. The example shows a basic interactive loop with exit conditions.

import sys # On Windows, pyreadline3 often patches sys.modules['readline'] # so standard 'import readline' works. Explicit import is also possible. try: import readline except ImportError: from pyreadline3 import Readline readline = Readline() print("pyreadline3 is active. Try typing, using arrow keys for history, or Tab (if configured).") print("Enter 'exit' to quit.") while True: try: user_input = input(">>> ") if user_input.lower() == 'exit': break if user_input: print(f"You typed: {user_input}") except EOFError: # Ctrl+D print("\nExiting (Ctrl+D detected).") break except KeyboardInterrupt: # Ctrl+C print("\nExiting (Ctrl+C detected).") break
Debug
Known issues
breakingpyreadline3 currently does not work with Python 3.13.0, as Python 3.13 introduced a new REPL. Even with `PYTHON_BASIC_REPL` environment variable set, history is not preserved across sessions.
fix
Use Python versions prior to 3.13 or monitor the pyreadline3 GitHub repository for updates and compatibility fixes for Python 3.13+.
affects: 3.x.x with Python >= 3.13
gotchaWhen managing history files with `readline.read_history_file()`, the specified history file must already exist. If it does not, a `FileNotFoundError` will be raised.
fix
Ensure the history file is created (e.g., `open(filename, 'w').close()`) before attempting to read from it.
affects: All versions
gotchapyreadline3 is primarily developed and tested for Windows environments to provide GNU readline functionality where it's natively absent. While it may technically install on other OS, its primary benefit is on Windows, and behavior on Unix-like systems (which have a native `readline` module) might be unexpected or redundant.
fix
Confirm you need `pyreadline3` for your specific operating system. On Unix-like systems, the built-in `readline` module is usually sufficient.
affects: All versions
gotchaThe Ctrl-C key binding has configurable behavior. By default, it might act as a copy operation, requiring a double-tap within a configurable time interval (`ctrl_c_tap_time_interval`) to raise a `KeyboardInterrupt`.
fix
Configure `allow_ctrl_c(True)` and adjust `ctrl_c_tap_time_interval(x)` in a configuration file (`pyreadlineconfig.ini`) or through `parse_and_bind` to customize Ctrl-C behavior.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyreadline3'
The `pyreadline3` package has not been installed in the current Python environment.
fix
pip install pyreadline3
AttributeError: module 'pyreadline3' has no attribute 'parse_and_bind'
Developers are attempting to call GNU readline-like functions directly as top-level methods of the `pyreadline3` module, instead of accessing them via the `pyreadline3.rlmain` submodule.
fix
import pyreadline3.rlmain as rl; rl.rl_parse_and_bind('tab: complete')
ModuleNotFoundError: No module named 'pyreadline'
The user is trying to import the deprecated `pyreadline` package or its submodules, while intending to use the newer `pyreadline3` package.
fix
Ensure `pyreadline3` is installed with `pip install pyreadline3`, and then use `import pyreadline3` or `from pyreadline3 import Readline` as appropriate.
Upgrade
Version history
3.5.6latest on PyPI · released May 14, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
Resources
pyreadline3 — pip install pyreadline3 · libregistry