Martin Panter added the comment:

Damn, detaching the intermediate buffered stream is a bit more awkward. The 
difference between the “io” and “_pyio” implementations boils down to:

* io.BufferedReader/Writer/ properties raise a ValueError if the 
stream is detached
* property returns “”. When detached, 
“self.raw” is None, so this causes an AttributeError.

This is significant because io.TextIOWrapper.__repr__() only handles 
AttributeError when accessing “”. The best option that I can 
think of to fix this is to make all the repr() implementations handle this 
ValueError exception.


Python tracker <>
Python-bugs-list mailing list

Reply via email to