8000 gh-127604: Don't rely on `dprintf()` for faulthandler C stacks by ZeroIntensity · Pull Request #132800 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127604: Don't rely on dprintf() for faulthandler C stacks #132800

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

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add dup()
  • Loading branch information
ZeroIntensity committed Apr 23, 2025
commit a3ded446acd0fa649d26cf72db70556a1a1eefba
4 changes: 3 additions & 1 deletion Python/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# include <winioctl.h> // FILE_DEVICE_* constants
# include "pycore_fileutils_windows.h" // FILE_STAT_BASIC_INFORMATION
# define fdopen _fdopen
# define dup _dup
# if defined(MS_WINDOWS_GAMES) && !defined(MS_WINDOWS_DESKTOP)
# define PATHCCH_ALLOW_LONG_PATHS 0x01
# else
Expand Down Expand Up @@ -2063,7 +2064,8 @@ _Py_write_noraise(int fd, const void *buf, size_t count)
int
_Py_fdprintf(int fd, const char *fmt, ...)
{
FILE *handle = fdopen(fd, "a");
int newfd = dup(fd);
FILE *handle = fdopen(newfd, "a");
va_list vargs;
va_start(vargs, fmt);
int res = vfprintf(handle, fmt, vargs);
Expand Down
Loading
0