Skip to content

micropython crashes with print(">>> ", end='') expression after roughly 0.02 seconds #13965

@Kyuchumimo

Description

@Kyuchumimo

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

rp2

MicroPython version

MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico with RP2040

Reproduction

import time

print('>>> ',end='')

while True:
    time.sleep(0.02)
    
    print("THIS SHOULD BE PRINTED!")

Expected behaviour

">>> " string without new line printed on shell

Observed behaviour

For some unknown reason, I can't print exactly what I want, which should be ">>> " without new line escape sequence (\n).

A workaround is to print ">>> \b" (three greater-than signs followed by two spaces and a backspace escape sequence (\b)).

To avoid crashes you need to print something after the print('>>> ',end='') in a time span of roughly less than 0.02 seconds, but as I said before, that is not the goal, i want to print exactly ">>> " without newline or any aditional characters, which I consider to be a bug.

Additional Information

No, I've provided everything above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions