Skip to content

[BUG] #10

Description

@Sanidhya-agr

Bug Description

The christ_terminal.py script fails to launch on Windows because it directly calls functions from the readline module (set_history_length, read_history_file, write_history_file) that are not available in the Windows-compatible pyreadline3 library. This results in an AttributeError and prevents Windows users from accessing the interactive terminal

Component Affected

  • C - Consciousness Capture
  • H - Holistic Self-Model
  • R - Retrieval & Reflection
  • I - Intent & Integrity
  • S - Simulation Engine
  • T - Teleology & Transformation
  • Core/Infrastructure
  • Documentation

To Reproduce

Steps to reproduce the behavior:
1:Set up the development environment on a Windows machine.

2: Install the required dependencies, including pyreadline3.

3: Run the command: python christ_terminal.py

4: See the AttributeError: module 'pyreadline3' has no attribute '..._history_file'.

Expected Behavior

The interactive terminal should launch successfully on Windows without crashing, providing command history and a stable user experience

Actual Behavior

The script immediately exits with an AttributeError traceback, making the terminal unusable on Windows.

Screenshots

Environment

  • OS: [e.g., Ubuntu 22.04, macOS 13.0, Windows 11]
  • Python Version: [e.g., 3.9.0]
  • C.H.R.I.S.T. Version: [e.g., 0.1.0]
  • Installation Method: [e.g., pip, docker, from source]

Error Messages

Traceback (most recent call last):
  File "D:\GITHUB_open\CHRIST\christ_terminal.py", line 541, in
    main()
  File "D:\GITHUB_open\CHRIST\christ_terminal.py", line 536, in main
    terminal = ChristTerminal()
  File "D:\GITHUB_open\CHRIST\christ_terminal.py", line 72, in init
    readline.read_history_file(history_file)
AttributeError: module 'pyreadline3' has no attribute 'read_history_file'

Additional Context

Privacy Checklist

  • I have removed all personal identifiable information from logs
  • I have removed all API keys and credentials
  • I have anonymized any user data in examples

Possible Solution

The script should be made platform-aware by checking for the existence of readline functions before calling them. This ensures the code runs smoothly on both Unix-like systems and Windows.

The fix is to wrap the calls in a conditional check using hasattr():

Related Issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions