Skip to content

Entering AUTO . causes crash in _auto_step() (bytes passed to %d) #264

@maxeem

Description

@maxeem

Description

PC-BASIC crashes when the AUTO command is entered with a period:

AUTO .

Instead of reporting a syntax error or handling the input gracefully, the interpreter crashes with a Python exception.

Steps to Reproduce

  1. Start PC-BASIC 2.0.7 (unreleased).
  2. At the Ok prompt enter:
AUTO .
  1. Press Enter.

Expected Behavior

PC-BASIC should either:

  • Reject the command with a BASIC syntax error, or
  • Ignore the invalid parameter and remain operational.

It should not terminate with an internal exception.

Actual Behavior

PC-BASIC crashes and displays:

TypeError: %d format: a real number is required, not bytes

Traceback:

File ".../implementation.py", line 370, in _auto_step
    numstr = b'%d' % (self._auto_linenum,)
TypeError: %d format: a real number is required, not bytes

Environment

  • PC-BASIC 2.0.7 (unreleased)
  • Python 3.14.4 (64-bit)
  • Linux 7.0.0-22-generic x86_64

Additional Information

The crash appears to occur because _auto_step() expects self._auto_linenum to be numeric, but it contains a bytes object when AUTO . is processed.

Crash log attached.

crash-20260604-dtgz1x9g.log

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions