-
-
Notifications
You must be signed in to change notification settings - Fork 246
output abnormal after reload(sys) #567
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
Comments
Whoa, pretty weird! Looks like reloading sys resets sys.stdout, so it's no longer our faked stdout. |
@twz915 Is there a use case for which this is important? It's the goal of bpython to behave the same as the interactive Python interpreter, so this is a bug, but one that would take some effort to fix. If it's important, we could use a fake |
Not that important, but useful when
I like |
You could design the fake |
I'm on the fence, I think monkeypatching in a new reload function is reasonable, but found in the reload docs is says
#593 fixes this in the way described above. |
@sebastinas Any possible issues with this? @twz915 I don't understand some of this: why is setdefaultencoding not available until sys is reloaded? Because I'm somewhat ignorant about encoding issues, could you describe why this is useful to you? Does #593 look good to you? |
@thomasballinger Thank you for all your efforts at first.
Why I met the issue is that I want to learn how
Notice that the result of Generally speaking, we rarely use
I think it's better everything is OK after |
In Python 3 this isn't a problem -- the attributes of sys are preserved on |
Current status of this: PR 593 fixes this, but we're not sure it's worth the complexity. |
closing as won't fix: this is only an issue in Python 2 when doing something not recommended by the docs, and my fix added too much complexity to the code. Thanks for reporting though! |
bpython output is missing or abnormal. I've tested that original Python shell or IPython, both of them work fine.
The text was updated successfully, but these errors were encountered: