Skip to content

Problem with python 3.14: sys module no longer defines ps1 and ps2 #229

@AndrewSwann

Description

@AndrewSwann

Having updated to version 3.14 of python, I get errors from sys.ps1 not being defined. This has been removed from the sys module of python for nointeractive shells, see python/cpython#130660. As a workaround I could patch pythontex3.py with

modified   pythontex/pythontex3.py
@@ -72,6 +72,9 @@ if sys.version_info[0] == 2:
     from io import open
 else:
     import pickle
+    if sys.version_info[0] == 3 and sys.version_info[1] >= 14:
+        sys.ps1 = ">>> "
+        sys.ps2 = "... "

But probably a more rigorous approach would be better, rather than relying on hardcoded strings.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions