GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-30555: Fix WindowsConsoleIO errors in the presence of fd redirection by segevfiner · Pull Request #1927 · python/cpython

bpo-30555: Fix WindowsConsoleIO errors in the presence of fd redirection #1927

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.

Sign up for GitHub

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

Merged
zooba merged 22 commits into python:master from segevfiner:bpo-30555-windowsconsoleio-fd-redirection
Apr 23, 2021

Uh oh!

There was an error while loading. Please reload this page.

Merged

bpo-30555: Fix WindowsConsoleIO errors in the presence of fd redirection #1927

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b02408d
bpo-30555: Fix WindowsConsoleIO failure in the presence of fd redirec…
segevfiner Jun 3, 2017
ac242eb
bpo-30555: Fixed the kludgey PC/_testconsole.c, grumble grumble...
segevfiner Jun 3, 2017
645dfa3
bpo-30555: Fix refleaks
segevfiner Jun 4, 2017
013d8ea
bpo-30555: Add _Py_{get,open}_osfhandle{,_noraise} and use them instead
segevfiner Jun 4, 2017
aaf6020
bpo-30555: Swapped the rest of the uses of _{get,open}_osfhandle
segevfiner Jun 4, 2017
7727bc5
bpo-30555: Swap intptr_t to void* in _Py_{get,open}_osfhandle{,_noraise}
segevfiner Jun 5, 2017
0644634
bpo-30555: msvcrtmodule.c: Use an argument clinic convertor instead o…
segevfiner Jun 5, 2017
82a18bb
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Jun 8, 2017
ad77cd3
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Jun 10, 2017
9dd4ea9
bpo-30555: Also consider NULL as a possible error in HANDLE_return_co…
segevfiner Jun 30, 2017
07a979f
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Jul 6, 2017
69b13f7
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Jul 27, 2017
e54f9c0
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Dec 16, 2017
2d252ab
Add NEWS.d entry for bpo-30555
segevfiner Dec 16, 2017
d1cce96
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Mar 9, 2018
64262c2
Merge remote-tracking branch 'origin/master' into bpo-30555-windowsco…
segevfiner Apr 14, 2019
36fccb4
Review fix
segevfiner Apr 14, 2019
40f678f
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Apr 14, 2019
116fe9c
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Nov 16, 2019
7990e20
Merge remote-tracking branch 'upstream/master' into bpo-30555-windows…
segevfiner Mar 16, 2021
bd8233e
fileno should error when closed
segevfiner Mar 16, 2021
b76da3e
Fix faulty call to IOBase.close introduced by automatic merge
segevfiner Mar 16, 2021
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Next Next commit
bpo-30555: Fix WindowsConsoleIO failure in the presence of fd redirec…
…tion

This works by not caching the handle and instead getting the handle from
the file descriptor each time, so that if the actual handle changes by
fd redirection closing/opening the console handle beneath our feet, we
will keep working correctly.

I think I also fixed some resource handling issues along the way since
ucrt/msvcrt fds *own* the HANDLEs they use and this module tried to
close them itself.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@segevfiner
segevfiner committed Jun 4, 2017
commit b02408d5d930a765b2f32991a8468e5bc2c0b948

There are no files selected for viewing

13 changes: 5 additions & 8 deletions 13 Modules/_io/clinic/winconsoleio.c.h
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_close__doc__,
"close($self, /)\n"
"--\n"
"\n"
"Close the handle.\n"
"Close the console object.\n"
"\n"
"A closed handle cannot be used for further I/O operations. close() may be\n"
"called more than once without error.");
"A closed console object cannot be used for further I/O operations.\n"
"close() may be called more than once without error.");

#define _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF \
{"close", (PyCFunction)_io__WindowsConsoleIO_close, METH_NOARGS, _io__WindowsConsoleIO_close__doc__},
Expand Down Expand Up @@ -73,10 +73,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_fileno__doc__,
"fileno($self, /)\n"
"--\n"
"\n"
"Return the underlying file descriptor (an integer).\n"
"\n"
"fileno is only set when a file descriptor is used to open\n"
"one of the standard streams.");
"Return the underlying file descriptor (an integer).");

#define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF \
{"fileno", (PyCFunction)_io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__},
Expand Down Expand Up @@ -332,4 +329,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored))
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
/*[clinic end generated code: output=f2a240ec6af12a20 input=a9049054013a1b77]*/
/*[clinic end generated code: output=91d7de6d9241470a input=a9049054013a1b77]*/
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.