You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug:
When using the sarge.Capture class with io.TextIOWrapper in Python 3.13, an AttributeError is raised because the Capture object does not have a flush method.
To Reproduce:
Install Python 3.13.0.
Run the following code:
Python 3.13.0 (main, Oct 7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sarge, io, sys
>>> p = sarge.Command('echo reproduce_me', stdout=sarge.Capture(buffer_size=-1), stderr=sarge.Capture(buffer_size=-1), shell=True)
>>> p.run()
Command('echo reproduce_me')
>>> p.stdout_text = io.TextIOWrapper(p.stdout, encoding=sys.stdout.encoding)
>>> p = sarge.Command('echo reproduce_me', stdout=sarge.Capture(buffer_size=-1), stderr=sarge.Capture(buffer_size=-1), shell=True)
>>> p.run()
Exception ignored in: <_io.TextIOWrapper encoding='utf-8'>
Traceback (most recent call last):
File "<python-input-5>", line 1, in <module>
AttributeError: 'Capture' object has no attribute 'flush'
Command('echo reproduce_me')
Expected behavior
Python 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sarge, io, sys
>>> p = sarge.Command('echo reproduce_me', stdout=sarge.Capture(buffer_size=-1), stderr=sarge.Capture(buffer_size=-1), shell=True)
>>> p.run()
Command('echo reproduce_me')
>>> p.stdout_text = io.TextIOWrapper(p.stdout, encoding=sys.stdout.encoding)
>>> p = sarge.Command('echo reproduce_me', stdout=sarge.Capture(buffer_size=-1)
... , stderr=sarge.Capture(buffer_size=-1), shell=True)
>>> p.run()
Command('echo reproduce_me')
Environment:
Python Version: 3.13.0
Sarge Version: v0.1.7.post1
Operating System: macOS 15.1.1
Additional context:
In Python 3.13, errors raised during the close() method of IOBase objects are now logged using sys.unraisablehook (see gh-62948). My best guess is that the issue does not occur in Python 3.12 or earlier because such errors were silently ignored unless explicitly enabled for debugging.
The text was updated successfully, but these errors were encountered:
Describe the bug:
When using the
sarge.Capture
class withio.TextIOWrapper
in Python 3.13, an AttributeError is raised because theCapture
object does not have aflush
method.To Reproduce:
Expected behavior
Environment:
Additional context:
In Python 3.13, errors raised during the
close()
method ofIOBase
objects are now logged usingsys.unraisablehook
(see gh-62948). My best guess is that the issue does not occur in Python 3.12 or earlier because such errors were silently ignored unless explicitly enabled for debugging.The text was updated successfully, but these errors were encountered: