-
Notifications
You must be signed in to change notification settings - Fork 4
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
Replace buffers inside of existing sys.std* wrappers #75
Comments
The current implementation replaces the streams in `sys`, which is not effective if those streams have already been stored in other modules, and can be problematic if the temporary replacement streams are copied into other modules as they are not able to be cleaned up by the context manager. Related to bskinn#75
The current implementation replaces the streams in `sys`, which is not effective if those streams have already been stored in other modules, and can be problematic if the temporary replacement streams are copied into other modules as they are not able to be cleaned up by the context manager. Related to bskinn#75
The current implementation replaces the streams in `sys`, which is not effective if those streams have already been stored in other modules, and can be problematic if the temporary replacement streams are copied into other modules as they are not able to be cleaned up by the context manager. Related to bskinn#75
The current implementation replaces the streams in `sys`, which is not effective if those streams have already been stored in other modules, and can be problematic if the temporary replacement streams are copied into other modules as they are not able to be cleaned up by the context manager. Related to bskinn#75
Another approach at https://stackoverflow.com/a/1736047 , and a comment links to https://stackoverflow.com/a/881751 which includes the Windows equivalent. |
As a bit of a summary of things found so far ... the documented There are benefits of keeping the 1 predicting/fixing where It is more feasible to detect (2), but it is a lot of work. It would be good to add some tests which demo each of these two problems with the current stdio_mgr. There is a good reason to not fiddle with the insides of But, if we do want to fiddle... The easy case is the linux console io streams (i.e. The hard case is the windows console io, which has a few modes, and has been constantly improving, but with backwards compatibility. The sub-case I have been targeting so far is
The main motivation of proceeding with this 'feature', even though it is discouraged by Python devs, is the situation like I had with coala, where implementing the current |
Hmmm... so, the internal noodling could be intended mainly as a debugging tool? Helping us diagnose weird things in different situations? |
Yes, and help users do the same. While the POC makes them the default implementation, that is mostly so that I can test the branch easily in other repos. That would be removed before being mergable - maybe replaced with envvars to force a potentially bad implementation for debugging/investigation purposes. |
Currently we replace the sys.std* objects with new wrappers.
It might be possible to detach the existing buffers in those wrappers, and attach new ones to the existing wrappers.
That solution is a superset of #74 , making it unnecessary.
This should be easier on py37 with its
TextIOWrapper.reconfigure
, but would be ok if we can create backports #33This possibly makes #64 less desirable, as-is.
The text was updated successfully, but these errors were encountered: