diff options
| author | Daniel Laügt <daniel.laugt@gmail.com> | 2022-11-17 16:29:05 +0100 |
|---|---|---|
| committer | Daniel Laügt <daniel.laugt@gmail.com> | 2022-11-17 16:53:57 +0100 |
| commit | 9b5a31f49dc1a9210405bbdd30c85a34ecf9c4b8 (patch) | |
| tree | fec84f609f8c20116a622d7f0b3f2214c4b3c3be /setuptools/dist.py | |
| parent | a0e8e53cecc238e3bce2247308fe7dd94114ef35 (diff) | |
| download | python-setuptools-git-9b5a31f49dc1a9210405bbdd30c85a34ecf9c4b8.tar.gz | |
Fix logging errors: 'underlying buffer has been detached'
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 82423548..c5c4c8fd 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -1195,19 +1195,11 @@ class Distribution(_Distribution): # Print metadata in UTF-8 no matter the platform encoding = sys.stdout.encoding - errors = sys.stdout.errors - newline = sys.platform != 'win32' and '\n' or None - line_buffering = sys.stdout.line_buffering - - sys.stdout = io.TextIOWrapper( - sys.stdout.detach(), 'utf-8', errors, newline, line_buffering - ) + sys.stdout.reconfigure(encoding='utf-8') try: return _Distribution.handle_display_options(self, option_order) finally: - sys.stdout = io.TextIOWrapper( - sys.stdout.detach(), encoding, errors, newline, line_buffering - ) + sys.stdout.reconfigure(encoding=encoding) def run_command(self, command): self.set_defaults() |
