File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -202,16 +202,16 @@ def readable(self):
202
202
# Open streams are currently always readable.
203
203
return not self .closed
204
204
205
- def read (self , b = None ):
205
+ def read (self , b = - 1 ):
206
206
"""Returns either the requested number of bytes or the entire stream.
207
207
208
208
:param int b: Number of bytes to read
209
209
:returns: Processed (encrypted or decrypted) bytes from source stream
210
210
:rtype: bytes
211
211
"""
212
- # Any negative value for b is interpreted as a full read
213
- if b is not None and b < 0 :
214
- b = None
212
+ # NoneType value for b is interpretted as a full read for legacy compatibility
213
+ if b is None :
214
+ b = - 1
215
215
216
216
_LOGGER .debug ("Stream read called, requesting %s bytes" , b )
217
217
output = io .BytesIO ()
You can’t perform that action at this time.
0 commit comments