The exceptions are different:
$ python3.1 -c 'open("/dev/null", "w").read()' Traceback (most recent call last): File "<string>", line 1, in <module> IOError: not readable $ python3.2 -c 'open("/dev/null", "w").read()' Traceback (most recent call last): File "<string>", line 1, in <module> io.UnsupportedOperation: not readable
The following fix works, but maybe _UnsupportedOperation should be changed.
--- python/subunit/__init__.py +++ python/subunit/__init__.py @@ -1280,7 +1280,7 @@ # Read streams if type(stream.read(0)) is str: return stream.buffer - except _UnsupportedOperation: + except (_UnsupportedOperation, IOError): # Cannot read from the stream: try via writes try: stream.write(_b(''))
===
The exceptions are different:
$ python3.1 -c 'open("/dev/null", "w").read()' peration: not readable
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: not readable
$ python3.2 -c 'open("/dev/null", "w").read()'
Traceback (most recent call last):
File "<string>", line 1, in <module>
io.UnsupportedO
The following fix works, but maybe _UnsupportedOpe ration should be changed.
--- python/ subunit/ __init_ _.py subunit/ __init_ _.py read(0) ) is str:
return stream.buffer ration: eration, IOError):
stream. write(_ b(''))
+++ python/
@@ -1280,7 +1280,7 @@
# Read streams
if type(stream.
- except _UnsupportedOpe
+ except (_UnsupportedOp
# Cannot read from the stream: try via writes
try:
===