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

Emulate reconfigure on Python 3.6 and lower #33

Closed
jayvdb opened this issue Aug 3, 2019 · 6 comments
Closed

Emulate reconfigure on Python 3.6 and lower #33

jayvdb opened this issue Aug 3, 2019 · 6 comments
Labels
enhancement New feature or request maybe This may or may not be implemented needs tests Tests are absent or incomplete for this
Milestone

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Aug 3, 2019

Im not sure how much effort is required, but if the streams have a .reconfigure then the context manager constructor doesnt need to have lots of arguments for possible configurations of the stream.

@jayvdb
Copy link
Contributor Author

jayvdb commented Aug 3, 2019

Maybe upstream this to six or future, if not already present there.

@bskinn bskinn added this to the v2.0 milestone Aug 3, 2019
@bskinn bskinn added enhancement New feature or request needs tests Tests are absent or incomplete for this maybe This may or may not be implemented labels Aug 3, 2019
@bskinn bskinn modified the milestones: v2.0, Future Aug 3, 2019
@bskinn
Copy link
Owner

bskinn commented Aug 3, 2019

<nod>, I hadn't realized how much less important the encodings were for mocks like this, as compared to the real streams.

Seems like classifying this for now as YAGNI is the best approach -- as you say, only worrying about implementation if a future user needs it.

@jayvdb
Copy link
Contributor Author

jayvdb commented Aug 3, 2019

We may run into problem with pytest, due to pytest-dev/pytest#4843 and pytest-dev/pytest#4389

@jayvdb
Copy link
Contributor Author

jayvdb commented Aug 3, 2019

Current code at https://github.com/python/cpython/blob/c4cacc8/Lib/_pyio.py#L2118 . It looks like most of it should be fairly easy to backport, except that write_through may not be possible / or be tricky on the C version of the objects. But the note on the __init__ indicates the .py version already differs from the C version in that regards.

I cant find an existing backport in future, and it looks way beyond scope for six.
https://github.com/kislyuk/eight/blob/fdd59842a92dc17bed5a372d64fc9e95f7285a8b/eight/__init__.py#L86 is one backport.

https://github.com/ipython/ipykernel/blob/master/ipykernel/iostream.py is a rewrite, which they apparently want to keep in sync with the wrapper class ipython/ipykernel#178 .

@jayvdb
Copy link
Contributor Author

jayvdb commented Sep 6, 2019

Created PythonCharmers/python-future#498 for adding backport there

@bskinn
Copy link
Owner

bskinn commented Nov 27, 2022

With 3.6 now firmly EOL, not going to bother with this.

@bskinn bskinn closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe This may or may not be implemented needs tests Tests are absent or incomplete for this
Projects
None yet
Development

No branches or pull requests

2 participants