Skip to content

Don't break due to our handles getting closed by FD redirection#131

Merged
wiggin15 merged 1 commit into
tartley:masterfrom
segevfiner:dont-break-on-fd-redirection
Oct 9, 2018
Merged

Don't break due to our handles getting closed by FD redirection#131
wiggin15 merged 1 commit into
tartley:masterfrom
segevfiner:dont-break-on-fd-redirection

Conversation

@segevfiner

Copy link
Copy Markdown
Contributor

The fix is to simply not cache the std handles returned by GetStdHandle

This happens in Pytest on at least Python 3.5 and 3.6.
Please check pytest-dev/pytest#2465 for more information about this before merging.

The fix is to simply not cache the std handles returned by `GetStdHandle`

This happens in Pytest on at least Python 3.5 and 3.6.
Please check pytest-dev/pytest#2465 for more
information about this.
@wiggin15

wiggin15 commented Jun 3, 2017

Copy link
Copy Markdown
Collaborator

This could be related to #114 and maybe #104 (comment) is also slightly related

@segevfiner

segevfiner commented Sep 21, 2018

Copy link
Copy Markdown
Contributor Author

Arghhhh, I started seeing this on Python 2.7 too. Who knows what changed that it's now triggered there too. Be it Pytest version, Windows version, or what not... This PR seems to fix it for that instance too, anyhow.

I still find the fact that this is random completely baffling... 😕

@Victorious3

Copy link
Copy Markdown

I would love to see this one fixed as well, ran into it when using pytest.

@nicoddemus

Copy link
Copy Markdown

I would love to see this one fixed as well, ran into it when using pytest.

I second that. @wiggin15 anything missing here? Anything else we can help with to get this merged and a new PyPI release?

@wiggin15 wiggin15 merged commit 855937f into tartley:master Oct 9, 2018
@nicoddemus

Copy link
Copy Markdown

Great, thanks a lot @wiggin15!

@wiggin15

wiggin15 commented Oct 9, 2018

Copy link
Copy Markdown
Collaborator

Just to make sure - is the problem in pytest related to stream redirection?
Any chance you can summarize the problem in one sentence for the changelog - something like "don't cache the std handles to avoid problems where/with ..."
Thanks.

@segevfiner

Copy link
Copy Markdown
Contributor Author

Just to make sure - is the problem in pytest related to stream redirection?
Any chance you can summarize the problem in one sentence for the changelog - something like "don't cache the std handles to avoid problems where/with ..."
Thanks.

Yes. It is caused by FD redirection (dup2). Windows is closing the underlying handle and they don't always end up with the same number when reopened. Maybe something like: "Don't cache stdio HANDLEs, since they might be closed/changed by fd redirection".

@wiggin15

Copy link
Copy Markdown
Collaborator

Thanks. There's a new release, 0.4.0, with this change.

@nicoddemus

Copy link
Copy Markdown

Awesome, thanks @wiggin15 for the prompt merge and release! 🙇

@segevfiner segevfiner deleted the dont-break-on-fd-redirection branch October 10, 2018 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants