Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop in Positron Python When Redirecting sys.stdout in Iterating (Not sure about title) #6238

Open
ZhimingYe opened this issue Feb 7, 2025 · 3 comments
Labels
bug Something isn't working lang: python support
Milestone

Comments

@ZhimingYe
Copy link

ZhimingYe commented Feb 7, 2025

System details:

Positron and OS details:

Positron Version: 2025.02.0 (Universal) build 79
Code - OSS Version: 1.96.0
Commit: a268bc8
Date: 2025-01-21T02:44:54.581Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.0.0

Interpreter details:

Python 3.11.10

Describe the issue:

The following code causes Positron Python to enter an infinite loop.

import gc
import sys

with open("gc_objects_Positron.txt", "w", encoding="utf-8") as f:
    sys.stdout = f
    for obj in gc.get_objects():
        print(obj)
    sys.stdout = sys.__stdout__
Image

Expected or desired behavior:

In terminal, ipython won't happen.

Image

Were there any error messages in the UI, Output panel, or Developer Tools console?

A very very large output is generated?

Image
@testlabauto
Copy link
Contributor

Thank you for your bug report, @ZhimingYe!

I am able to reproduce locally and am moving this issue to triage for prioritization.

(Note that the provided sample code runs quickly to completion when run outside Positron)

@juliasilge juliasilge added bug Something isn't working support labels Feb 10, 2025
@juliasilge
Copy link
Contributor

Let's see if this works in a Jupyter notebook and/or in ipython.

@juliasilge juliasilge added this to the Future milestone Feb 12, 2025
@ZhimingYe
Copy link
Author

ZhimingYe commented Feb 13, 2025

Let's see if this works in a Jupyter notebook and/or in ipython.

@juliasilge Thanks for your reply! In this issue's "Expected or desired behavior" part I used ipython for testing, and there wasn't any bug. But I agree with that this is not a high priority issue, and can be moved to milestones after the first stable version is released😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang: python support
Projects
None yet
Development

No branches or pull requests

3 participants