Skip to content

Low recursion limit on Windows port with MSVC #2927

Closed
@ARF1

Description

I ran into a Maximum recursion depth exceeded error while developing on micropython on Windows. I was somewhat surprised as I did not think that my code was excessively complex.

I used the code from this forum post to test the recursion depth:

MicroPython v1.8.7 on 2017-03-02; win32 version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== a = 0
=== fail = False
=== def foo():
===     global a, fail
===     a += 1
===     if not fail:
===         try:
===             foo()
===         except:
===             fail = True
===
=== foo()
=== print(a)
12
>>>

It seems the recursion depth is 12 on Windows? Can that be right? How is it controlled? The same forum post mentions that on the Unix build, the recursion depth is 166. Even on the esp8266 it seems to be 19.

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