Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow omitting _pyrepl module #145035

Copy link
Copy link
@zooba

Description

@zooba
Issue body actions

Currently, launching Python without the _pyrepl module present causes it to abort. It would be better if it simply went into regular repl mode, rather than requiring the user to set an env var, as this would allow distributors to simply omit the module rather than having to patch and rebuild CPython.

cpython/Modules/main.c

Lines 281 to 286 in 175ab31

PyObject *pyrepl = PyImport_ImportModule("_pyrepl.main");
if (pyrepl == NULL) {
fprintf(stderr, "Could not import _pyrepl.main\n");
res = pymain_exit_err_print();
goto done;
}

I would prefer messages about ModuleNotFoundError here to only be shown in verbose mode, though other errors could still cause a full failure (if that's what the maintainers think is best... I disagree, but it's not important to me like ModuleNotFoundError would be).

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.