reloadware / reloadium

Hot Reloading and Profiling for Python
https://reloadium.io
Apache License 2.0
2.74k stars 56 forks source link

two big bugs! no support for "break" and inline loop #158

Closed jialay closed 11 months ago

jialay commented 11 months ago

Describe the bug*

I am confront with two bugs, key word "break" in "for loop" and inline loop are not supported in hot reload run. It output the error info: "Process finished with exit code -1073741819 (0xC0000005)".

here is the test code:

site=[0,2,2,2] site=[ii for ii in site if ii!=0] print('test') for ii in site: if ii==2: break print('finished')

when in debug mode, this code can run well in the first time, when something changed, such as print('somethin others'), it will quit directly when hot reload is triggered, and output the upper error code.

Desktop or remote (please complete the following information):**

Additional context

Add any other context about the problem here.

dkrystki commented 11 months ago

Hi @jialay Good catch! Thanks for opening this issue. I've managed to fix the break issue but cannot reproduce the "inline loop" problem. Do you mean the line comprehension in the second line? Also could you provide the full version of your python interpreter (eg 3.9.8 )?

jialay commented 11 months ago

Hi, dkrystki, thank you for the great tool reloadium! yes, the inline loop is just show as the second line. I tried it with python 3.9.12( debian 9, remote debug mode), and 3.10.0(windows 10, local mode), both of the them can't support hot reload。 such as the following code:

site=[0,2,2,2] site=[ii for ii in site if ii!=0] print('test') print('finished')

debug with a breakpoint at line "print('finished')", any change of the code will interrupte the debug.